-/* $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.
*
#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)
return ok;
}
+LCRYPTO_ALIAS(DSA_generate_key);
+
#endif