Merge branch 'tmp-nettle4' into 'master'

Build against GNU Nettle 4

Closes #697

See merge request openconnect/ocserv!553
This commit is contained in:
Nikos Mavrogiannopoulos
2026-05-21 06:35:54 +00:00
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
- Fixed HTTP request desynchronization: pipelined requests in the same
TLS record are now rejected instead of being processed out of order (#716)
- Fix build issue on FreeBSD (#704)
- Build against Nettle 4.
- Build against Nettle 4 (#697)
- Removed unnecessary for openconnect client handlers to reduce attack surface:
* /cert.pem
* /cert.cer
+5
View File
@@ -33,6 +33,7 @@
#include <limits.h>
#include <assert.h>
#include <nettle/sha1.h>
#include <nettle/version.h>
#include "common.h"
#include "defs.h"
#include "common/base64-helper.h"
@@ -59,7 +60,11 @@ static void safe_hash(const uint8_t *data, unsigned int data_size,
sha1_init(&ctx);
sha1_update(&ctx, data_size, data);
#if NETTLE_VERSION_MAJOR >= 4
sha1_digest(&ctx, output);
#else
sha1_digest(&ctx, 20, output);
#endif
}
char *calc_safe_id(const uint8_t *data, unsigned int size, char *output,
+2 -1
View File
@@ -26,6 +26,7 @@
#include <gnutls/crypto.h>
#include <gnutls/abstract.h>
#include <nettle/hmac.h>
#include <nettle/version.h>
#include <common.h>
#include <hmac.h>
#include <stdbool.h>
@@ -51,7 +52,7 @@ void generate_hmac(size_t key_length, const uint8_t *key,
}
}
#if NETTLE_MAJOR >= 4
#if NETTLE_VERSION_MAJOR >= 4
hmac_sha256_digest(&ctx, digest);
#else
hmac_sha256_digest(&ctx, HMAC_DIGEST_SIZE, digest);