sync with OpenBSD -current

This commit is contained in:
purplerain 2024-03-31 19:11:21 +00:00
parent 38a9ea224a
commit 61b0c3d2c1
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
27 changed files with 196 additions and 125 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: crypto_namespace.h,v 1.2 2023/02/16 08:38:17 tb Exp $ */
/* $OpenBSD: crypto_namespace.h,v 1.3 2024/03/30 10:09:43 tb Exp $ */
/*
* Copyright (c) 2016 Philip Guenther <guenther@openbsd.org>
*
@ -25,14 +25,17 @@
*/
#ifdef LIBRESSL_NAMESPACE
# define LCRYPTO_UNUSED(x) typeof(x) x __attribute__((deprecated))
#ifdef LIBRESSL_CRYPTO_NAMESPACE
# define LCRYPTO_USED(x) __attribute__((visibility("hidden"))) \
# define LCRYPTO_UNUSED(x) __attribute__((deprecated)) \
__attribute__((visibility("hidden"))) \
typeof(x) x asm("_lcry_"#x)
# define LCRYPTO_USED(x) __attribute__((visibility("hidden"))) \
typeof(x) x asm("_lcry_"#x)
# define LCRYPTO_ALIAS1(pre,x) asm(".global "#pre#x"; "#pre#x" = _lcry_"#x)
# define LCRYPTO_ALIAS(x) LCRYPTO_ALIAS1(,x); LCRYPTO_ALIAS1(_libre_,x)
#else
# define LCRYPTO_USED(x) typeof(x) x asm("_libre_"#x)
# define LCRYPTO_UNUSED(x) typeof(x) x __attribute__((deprecated))
# define LCRYPTO_USED(x) typeof(x) x asm("_libre_"#x)
#endif
#else
# define LCRYPTO_UNUSED(x)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: hmac.c,v 1.33 2024/03/26 12:10:50 joshua Exp $ */
/* $OpenBSD: hmac.c,v 1.34 2024/03/30 10:10:58 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -143,6 +143,7 @@ HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md)
HMAC_CTX_init(ctx);
return HMAC_Init_ex(ctx, key, len, md, NULL);
}
LCRYPTO_ALIAS(HMAC_Init);
int
HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len)
@ -203,6 +204,7 @@ HMAC_CTX_reset(HMAC_CTX *ctx)
HMAC_CTX_init(ctx);
return 1;
}
LCRYPTO_ALIAS(HMAC_CTX_reset);
void
HMAC_CTX_init(HMAC_CTX *ctx)