sync with OpenBSD -current

This commit is contained in:
purplerain 2024-05-10 01:59:48 +00:00
parent 01ab08895c
commit 492219ffd1
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
35 changed files with 666 additions and 546 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: dsa_ossl.c,v 1.53 2023/08/03 18:53:55 tb Exp $ */
/* $OpenBSD: dsa_ossl.c,v 1.55 2024/05/09 20:57:49 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -69,30 +69,6 @@
#include "bn_local.h"
#include "dsa_local.h"
static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
BIGNUM **rp);
static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
DSA *dsa);
static int dsa_init(DSA *dsa);
static int dsa_finish(DSA *dsa);
static DSA_METHOD openssl_dsa_meth = {
.name = "OpenSSL DSA method",
.dsa_do_sign = dsa_do_sign,
.dsa_sign_setup = dsa_sign_setup,
.dsa_do_verify = dsa_do_verify,
.init = dsa_init,
.finish = dsa_finish,
};
const DSA_METHOD *
DSA_OpenSSL(void)
{
return &openssl_dsa_meth;
}
LCRYPTO_ALIAS(DSA_OpenSSL);
/*
* Since DSA parameters are entirely arbitrary and checking them to be
* consistent is very expensive, we cannot do so on every sign operation.
@ -436,6 +412,22 @@ dsa_finish(DSA *dsa)
return 1;
}
static const DSA_METHOD openssl_dsa_meth = {
.name = "OpenSSL DSA method",
.dsa_do_sign = dsa_do_sign,
.dsa_sign_setup = dsa_sign_setup,
.dsa_do_verify = dsa_do_verify,
.init = dsa_init,
.finish = dsa_finish,
};
const DSA_METHOD *
DSA_OpenSSL(void)
{
return &openssl_dsa_meth;
}
LCRYPTO_ALIAS(DSA_OpenSSL);
DSA_SIG *
DSA_SIG_new(void)
{