sync with OpenBSD -current

This commit is contained in:
purplerain 2024-06-02 01:52:29 +00:00
parent 7c962f73cd
commit 0d61274b26
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
18 changed files with 90 additions and 103 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: sha.h,v 1.22 2023/07/08 07:08:11 jsing Exp $ */
/* $OpenBSD: sha.h,v 1.25 2024/06/01 08:11:44 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -102,7 +102,8 @@ int SHA1_Update(SHA_CTX *c, const void *data, size_t len)
__attribute__ ((__bounded__(__buffer__, 2, 3)));
int SHA1_Final(unsigned char *md, SHA_CTX *c);
unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
__attribute__ ((__bounded__(__buffer__, 1, 2)));
__attribute__ ((__bounded__(__buffer__, 1, 2)))
__attribute__ ((__nonnull__(3)));
void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
#endif
@ -125,13 +126,15 @@ int SHA224_Update(SHA256_CTX *c, const void *data, size_t len)
__attribute__ ((__bounded__(__buffer__, 2, 3)));
int SHA224_Final(unsigned char *md, SHA256_CTX *c);
unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md)
__attribute__ ((__bounded__(__buffer__, 1, 2)));
__attribute__ ((__bounded__(__buffer__, 1, 2)))
__attribute__ ((__nonnull__(3)));
int SHA256_Init(SHA256_CTX *c);
int SHA256_Update(SHA256_CTX *c, const void *data, size_t len)
__attribute__ ((__bounded__(__buffer__, 2, 3)));
int SHA256_Final(unsigned char *md, SHA256_CTX *c);
unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md)
__attribute__ ((__bounded__(__buffer__, 1, 2)));
__attribute__ ((__bounded__(__buffer__, 1, 2)))
__attribute__ ((__nonnull__(3)));
void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
#endif
@ -172,13 +175,15 @@ int SHA384_Update(SHA512_CTX *c, const void *data, size_t len)
__attribute__ ((__bounded__(__buffer__, 2, 3)));
int SHA384_Final(unsigned char *md, SHA512_CTX *c);
unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md)
__attribute__ ((__bounded__(__buffer__, 1, 2)));
__attribute__ ((__bounded__(__buffer__, 1, 2)))
__attribute__ ((__nonnull__(3)));
int SHA512_Init(SHA512_CTX *c);
int SHA512_Update(SHA512_CTX *c, const void *data, size_t len)
__attribute__ ((__bounded__(__buffer__, 2, 3)));
int SHA512_Final(unsigned char *md, SHA512_CTX *c);
unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md)
__attribute__ ((__bounded__(__buffer__, 1, 2)));
__attribute__ ((__bounded__(__buffer__, 1, 2)))
__attribute__ ((__nonnull__(3)));
void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
#endif

View file

@ -1,4 +1,4 @@
/* $OpenBSD: sha1.c,v 1.14 2024/03/28 07:06:12 jsing Exp $ */
/* $OpenBSD: sha1.c,v 1.15 2024/06/01 07:36:16 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -496,10 +496,6 @@ unsigned char *
SHA1(const unsigned char *d, size_t n, unsigned char *md)
{
SHA_CTX c;
static unsigned char m[SHA_DIGEST_LENGTH];
if (md == NULL)
md = m;
if (!SHA1_Init(&c))
return NULL;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: sha256.c,v 1.31 2024/03/28 04:23:02 jsing Exp $ */
/* $OpenBSD: sha256.c,v 1.32 2024/06/01 07:36:16 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
*
@ -317,10 +317,6 @@ unsigned char *
SHA224(const unsigned char *d, size_t n, unsigned char *md)
{
SHA256_CTX c;
static unsigned char m[SHA224_DIGEST_LENGTH];
if (md == NULL)
md = m;
SHA224_Init(&c);
SHA256_Update(&c, d, n);
@ -479,10 +475,6 @@ unsigned char *
SHA256(const unsigned char *d, size_t n, unsigned char *md)
{
SHA256_CTX c;
static unsigned char m[SHA256_DIGEST_LENGTH];
if (md == NULL)
md = m;
SHA256_Init(&c);
SHA256_Update(&c, d, n);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: sha512.c,v 1.41 2023/07/08 12:24:10 beck Exp $ */
/* $OpenBSD: sha512.c,v 1.42 2024/06/01 07:36:16 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
*
@ -345,10 +345,6 @@ unsigned char *
SHA384(const unsigned char *d, size_t n, unsigned char *md)
{
SHA512_CTX c;
static unsigned char m[SHA384_DIGEST_LENGTH];
if (md == NULL)
md = m;
SHA384_Init(&c);
SHA512_Update(&c, d, n);
@ -498,10 +494,6 @@ unsigned char *
SHA512(const unsigned char *d, size_t n, unsigned char *md)
{
SHA512_CTX c;
static unsigned char m[SHA512_DIGEST_LENGTH];
if (md == NULL)
md = m;
SHA512_Init(&c);
SHA512_Update(&c, d, n);