mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
[PR #2186] os: fix sha1 build error with Nettle 4.0
PR: https://github.com/X11Libre/xserver/pull/2186
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult
parent
25b68fb3de
commit
b5ced54f1b
@@ -385,7 +385,7 @@ foreach t : test_sha1
|
||||
sha1_dep = libsha1_dep
|
||||
endif
|
||||
elif t == 'libnettle'
|
||||
nettle_dep = dependency('nettle', required: false)
|
||||
nettle_dep = dependency('nettle', version: '>= 2.6', required: false)
|
||||
if nettle_dep.found()
|
||||
sha1_found = true
|
||||
sha1_dep = nettle_dep
|
||||
|
||||
@@ -149,7 +149,8 @@ x_sha1_final(void *ctx, unsigned char result[20])
|
||||
|
||||
#elif defined(HAVE_SHA1_IN_LIBNETTLE) /* Use libnettle for SHA1 */
|
||||
|
||||
#include <nettle/sha.h>
|
||||
#include <nettle/sha1.h>
|
||||
#include <nettle/version.h>
|
||||
|
||||
void *
|
||||
x_sha1_init(void)
|
||||
@@ -172,7 +173,11 @@ x_sha1_update(void *ctx, void *data, int size)
|
||||
int
|
||||
x_sha1_final(void *ctx, unsigned char result[20])
|
||||
{
|
||||
#if NETTLE_VERSION_MAJOR < 4
|
||||
sha1_digest(ctx, 20, result);
|
||||
#else
|
||||
sha1_digest(ctx, result);
|
||||
#endif
|
||||
free(ctx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user