summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2019-04-06 08:34:43 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2019-04-06 12:33:07 +0200
commitb5dfa6ce92131f803d4d672314c92d7aa6f6e22c (patch)
tree95ee2b79cfad59db2ca9f30ca48fd3d4cd888f0c
parenta34ca47f433478fb70304b16593c724a2f85f3a3 (diff)
downloadgnutls-tmp-cmac-cfb8-fix.tar.gz
nettle: include config.h before checking for definitionstmp-cmac-cfb8-fix
This makes sure that we don't include the internal backport if compiled with a version of nettle that includes that code. We also exclude nettle/backport from the static analyzer's list as it contains files outside our control (from nettle project). Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--lib/nettle/backport/cfb8.c4
-rw-r--r--lib/nettle/backport/cmac.c4
3 files changed, 9 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 66a9273ded..242b3587d3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -281,7 +281,7 @@ static-analyzers.Fedora.x86_64:
- scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C lib
- scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C libdane
- make -j$(nproc) -C src/gl && scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C src
- - cppcheck --force -q -Ilib/include -Igl/ -Ilib/ -I. --error-exitcode=1 lib/ -i lib/unistring -i lib/minitasn1 -j$(nproc) $CPPCHECK_OPTIONS
+ - cppcheck --force -q -Ilib/include -Igl/ -Ilib/ -I. --error-exitcode=1 lib/ -i lib/unistring -i lib/minitasn1 -i lib/nettle/backport -j$(nproc) $CPPCHECK_OPTIONS
- cppcheck --force -q -Ilib/include -Igl/ -Ilibdane/ -I. --error-exitcode=1 libdane/ -j$(nproc) $CPPCHECK_OPTIONS
after_script:
- /bin/true
diff --git a/lib/nettle/backport/cfb8.c b/lib/nettle/backport/cfb8.c
index 0febf647fd..e9816feb78 100644
--- a/lib/nettle/backport/cfb8.c
+++ b/lib/nettle/backport/cfb8.c
@@ -37,6 +37,10 @@
* #############################################
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#ifndef HAVE_NETTLE_CFB8_ENCRYPT
#include "cfb8.h"
diff --git a/lib/nettle/backport/cmac.c b/lib/nettle/backport/cmac.c
index 0791775cfd..a665f0ea6b 100644
--- a/lib/nettle/backport/cmac.c
+++ b/lib/nettle/backport/cmac.c
@@ -38,6 +38,10 @@
* #############################################
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#ifndef HAVE_NETTLE_CMAC128_UPDATE
#include <nettle/aes.h>