From: tb Date: Fri, 10 May 2024 04:53:55 +0000 (+0000) Subject: Inline dsa_builtin_keygen() in DSA_generate_key() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bd7c3e4df7f6426cd5e572c80de49047e53e7f3c;p=openbsd Inline dsa_builtin_keygen() in DSA_generate_key() ok djm --- diff --git a/lib/libcrypto/dsa/dsa_key.c b/lib/libcrypto/dsa/dsa_key.c index 431748ab75f..46ec9cfce97 100644 --- a/lib/libcrypto/dsa/dsa_key.c +++ b/lib/libcrypto/dsa/dsa_key.c @@ -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