sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-09-03 15:39:40 +00:00
parent 361861c7dd
commit 151b4b8168
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
25 changed files with 175 additions and 79 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: m_md5_sha1.c,v 1.7 2023/07/07 19:37:53 beck Exp $ */
/* $OpenBSD: m_md5_sha1.c,v 1.8 2023/09/02 04:55:18 tb Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
*
@ -44,7 +44,7 @@ md5_sha1_init(EVP_MD_CTX *ctx)
return 1;
}
static int
static int
md5_sha1_update(EVP_MD_CTX *ctx, const void *data, size_t count)
{
struct md5_sha1_ctx *mdctx = ctx->md_data;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: p_lib.c,v 1.35 2023/09/01 17:12:19 tb Exp $ */
/* $OpenBSD: p_lib.c,v 1.36 2023/09/02 04:15:39 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -449,12 +449,13 @@ EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
RSA *
EVP_PKEY_get1_RSA(EVP_PKEY *pkey)
{
if (pkey->type != EVP_PKEY_RSA) {
EVPerror(EVP_R_EXPECTING_AN_RSA_KEY);
return NULL;
if (pkey->type == EVP_PKEY_RSA || pkey->type == EVP_PKEY_RSA_PSS) {
RSA_up_ref(pkey->pkey.rsa);
return pkey->pkey.rsa;
}
RSA_up_ref(pkey->pkey.rsa);
return pkey->pkey.rsa;
EVPerror(EVP_R_EXPECTING_AN_RSA_KEY);
return NULL;
}
int