diff options
| author | Timo Weingärtner <timo@tiwe.de> | 2026-03-07 18:44:02 +0100 |
|---|---|---|
| committer | Timo Weingärtner <timo@tiwe.de> | 2026-03-07 22:25:16 +0100 |
| commit | c212ae94dce33e150bc384db54a3c4d471c75bd7 (patch) | |
| tree | 1b4c82e734526c376971af57af3cc98d8c9b4a27 | |
| parent | 60b84f1d9e64254c817bfa1b9a54a1a723af0712 (diff) | |
| download | ssh-agent-filter-c212ae94dce33e150bc384db54a3c4d471c75bd7.tar.gz | |
follow API break of nettle 4
| -rw-r--r-- | ssh-agent-filter.C | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C index 3fe4801..8a2772d 100644 --- a/ssh-agent-filter.C +++ b/ssh-agent-filter.C @@ -77,6 +77,7 @@ using std::pair; #include <sys/un.h> #include <sys/wait.h> #include <sysexits.h> +#include <nettle/version.h> #include <nettle/md5.h> #include <nettle/base64.h> #include <nettle/base16.h> @@ -112,7 +113,11 @@ string md5_hex (string const & s) { md5_init(&ctx); md5_update(&ctx, s.size(), reinterpret_cast<uint8_t const *>(s.data())); std::array<uint8_t, MD5_DIGEST_SIZE> bin; +#if (NETTLE_VERSION_MAJOR >= 4) + md5_digest(&ctx, bin.data()); +#else md5_digest(&ctx, MD5_DIGEST_SIZE, bin.data()); +#endif std::array<char, BASE16_ENCODE_LENGTH(MD5_DIGEST_SIZE)> hex; base16_encode_update(hex.data(), MD5_DIGEST_SIZE, bin.data()); return {begin(hex), end(hex)}; |
