Avoid need to change function code.
Keep original function names for nonce versions so we don't have to change error function codes.
This commit is contained in:
parent
190c615d43
commit
8d6a75dc3a
@ -72,8 +72,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
|
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_sign_setup_no_digest(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
|
||||||
static int dsa_sign_setup_with_digest(DSA *dsa, BN_CTX *ctx_in,
|
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||||
BIGNUM **kinvp, BIGNUM **rp,
|
BIGNUM **kinvp, BIGNUM **rp,
|
||||||
const unsigned char *dgst, int dlen);
|
const unsigned char *dgst, int dlen);
|
||||||
static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
|
||||||
@ -84,7 +84,7 @@ static int dsa_finish(DSA *dsa);
|
|||||||
static DSA_METHOD openssl_dsa_meth = {
|
static DSA_METHOD openssl_dsa_meth = {
|
||||||
"OpenSSL DSA method",
|
"OpenSSL DSA method",
|
||||||
dsa_do_sign,
|
dsa_do_sign,
|
||||||
dsa_sign_setup,
|
dsa_sign_setup_no_digest,
|
||||||
dsa_do_verify,
|
dsa_do_verify,
|
||||||
NULL, /* dsa_mod_exp, */
|
NULL, /* dsa_mod_exp, */
|
||||||
NULL, /* dsa_bn_mod_exp, */
|
NULL, /* dsa_bn_mod_exp, */
|
||||||
@ -179,7 +179,7 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
|
|||||||
redo:
|
redo:
|
||||||
if ((dsa->kinv == NULL) || (dsa->r == NULL))
|
if ((dsa->kinv == NULL) || (dsa->r == NULL))
|
||||||
{
|
{
|
||||||
if (!dsa_sign_setup_with_digest(dsa,ctx,&kinv,&r,dgst,dlen))
|
if (!dsa_sign_setup(dsa,ctx,&kinv,&r,dgst,dlen))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -239,12 +239,12 @@ err:
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
static int dsa_sign_setup_no_digest(DSA *dsa, BN_CTX *ctx_in,
|
||||||
BIGNUM **kinvp, BIGNUM **rp) {
|
BIGNUM **kinvp, BIGNUM **rp) {
|
||||||
return dsa_sign_setup_with_digest(dsa, ctx_in, kinvp, rp, NULL, 0);
|
return dsa_sign_setup(dsa, ctx_in, kinvp, rp, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dsa_sign_setup_with_digest(DSA *dsa, BN_CTX *ctx_in,
|
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
|
||||||
BIGNUM **kinvp, BIGNUM **rp,
|
BIGNUM **kinvp, BIGNUM **rp,
|
||||||
const unsigned char *dgst, int dlen)
|
const unsigned char *dgst, int dlen)
|
||||||
{
|
{
|
||||||
|
@ -66,9 +66,9 @@
|
|||||||
|
|
||||||
static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dlen,
|
static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dlen,
|
||||||
const BIGNUM *, const BIGNUM *, EC_KEY *eckey);
|
const BIGNUM *, const BIGNUM *, EC_KEY *eckey);
|
||||||
static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
|
static int ecdsa_sign_setup_no_digest(EC_KEY *eckey,
|
||||||
BIGNUM **rp);
|
BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
|
||||||
static int ecdsa_sign_setup_with_digest(EC_KEY *eckey, BN_CTX *ctx_in,
|
static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
|
||||||
BIGNUM **kinvp, BIGNUM **rp,
|
BIGNUM **kinvp, BIGNUM **rp,
|
||||||
const unsigned char *dgst, int dlen);
|
const unsigned char *dgst, int dlen);
|
||||||
static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
|
static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
|
||||||
@ -77,7 +77,7 @@ static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
|
|||||||
static ECDSA_METHOD openssl_ecdsa_meth = {
|
static ECDSA_METHOD openssl_ecdsa_meth = {
|
||||||
"OpenSSL ECDSA method",
|
"OpenSSL ECDSA method",
|
||||||
ecdsa_do_sign,
|
ecdsa_do_sign,
|
||||||
ecdsa_sign_setup,
|
ecdsa_sign_setup_no_digest,
|
||||||
ecdsa_do_verify,
|
ecdsa_do_verify,
|
||||||
#if 0
|
#if 0
|
||||||
NULL, /* init */
|
NULL, /* init */
|
||||||
@ -92,12 +92,12 @@ const ECDSA_METHOD *ECDSA_OpenSSL(void)
|
|||||||
return &openssl_ecdsa_meth;
|
return &openssl_ecdsa_meth;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
|
static int ecdsa_sign_setup_no_digest(EC_KEY *eckey,
|
||||||
BIGNUM **rp) {
|
BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) {
|
||||||
return ecdsa_sign_setup_with_digest(eckey, ctx_in, kinvp, rp, NULL, 0);
|
return ecdsa_sign_setup(eckey, ctx_in, kinvp, rp, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ecdsa_sign_setup_with_digest(EC_KEY *eckey, BN_CTX *ctx_in,
|
static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
|
||||||
BIGNUM **kinvp, BIGNUM **rp,
|
BIGNUM **kinvp, BIGNUM **rp,
|
||||||
const unsigned char *dgst, int dlen)
|
const unsigned char *dgst, int dlen)
|
||||||
{
|
{
|
||||||
@ -327,7 +327,7 @@ static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dgst_len,
|
|||||||
{
|
{
|
||||||
if (in_kinv == NULL || in_r == NULL)
|
if (in_kinv == NULL || in_r == NULL)
|
||||||
{
|
{
|
||||||
if (!ecdsa_sign_setup_with_digest(
|
if (!ecdsa_sign_setup(
|
||||||
eckey, ctx, &kinv, &ret->r, dgst, dgst_len))
|
eckey, ctx, &kinv, &ret->r, dgst, dgst_len))
|
||||||
{
|
{
|
||||||
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN,ERR_R_ECDSA_LIB);
|
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN,ERR_R_ECDSA_LIB);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user