sync with OpenBSD -current
This commit is contained in:
parent
492219ffd1
commit
087a435dae
17 changed files with 98 additions and 184 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: dsa_key.c,v 1.35 2023/08/03 18:53:55 tb Exp $ */
|
||||
/* $OpenBSD: dsa_key.c,v 1.36 2024/05/10 04:53:55 tb Exp $ */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
|
@ -69,24 +69,16 @@
|
|||
#include "bn_local.h"
|
||||
#include "dsa_local.h"
|
||||
|
||||
static int dsa_builtin_keygen(DSA *dsa);
|
||||
|
||||
int
|
||||
DSA_generate_key(DSA *dsa)
|
||||
{
|
||||
if (dsa->meth->dsa_keygen)
|
||||
return dsa->meth->dsa_keygen(dsa);
|
||||
return dsa_builtin_keygen(dsa);
|
||||
}
|
||||
LCRYPTO_ALIAS(DSA_generate_key);
|
||||
|
||||
static int
|
||||
dsa_builtin_keygen(DSA *dsa)
|
||||
{
|
||||
BIGNUM *pub_key = NULL, *priv_key = NULL;
|
||||
BN_CTX *ctx = NULL;
|
||||
int ok = 0;
|
||||
|
||||
if (dsa->meth->dsa_keygen != NULL)
|
||||
return dsa->meth->dsa_keygen(dsa);
|
||||
|
||||
if ((priv_key = BN_new()) == NULL)
|
||||
goto err;
|
||||
if ((pub_key = BN_new()) == NULL)
|
||||
|
@ -117,4 +109,6 @@ dsa_builtin_keygen(DSA *dsa)
|
|||
|
||||
return ok;
|
||||
}
|
||||
LCRYPTO_ALIAS(DSA_generate_key);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue