OpenSSL 1.1.1-pre2
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -20,7 +20,7 @@ int ossl_ecdsa_sign(int type, const unsigned char *dgst, int dlen,
|
||||
const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey)
|
||||
{
|
||||
ECDSA_SIG *s;
|
||||
RAND_seed(dgst, dlen);
|
||||
|
||||
s = ECDSA_do_sign_ex(dgst, dlen, kinv, r, eckey);
|
||||
if (s == NULL) {
|
||||
*siglen = 0;
|
||||
@@ -97,7 +97,7 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
|
||||
goto err;
|
||||
}
|
||||
} else {
|
||||
if (!BN_rand_range(k, order)) {
|
||||
if (!BN_priv_rand_range(k, order)) {
|
||||
ECerr(EC_F_ECDSA_SIGN_SETUP,
|
||||
EC_R_RANDOM_NUMBER_GENERATION_FAILED);
|
||||
goto err;
|
||||
@@ -199,7 +199,7 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
|
||||
BN_CTX_free(ctx);
|
||||
EC_POINT_free(tmp_point);
|
||||
BN_clear_free(X);
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ossl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
|
||||
@@ -301,7 +301,7 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
|
||||
}
|
||||
if (BN_is_zero(s)) {
|
||||
/*
|
||||
* if kinv and r have been supplied by the caller don't to
|
||||
* if kinv and r have been supplied by the caller, don't
|
||||
* generate new kinv and r values
|
||||
*/
|
||||
if (in_kinv != NULL && in_r != NULL) {
|
||||
@@ -344,7 +344,7 @@ int ossl_ecdsa_verify(int type, const unsigned char *dgst, int dgst_len,
|
||||
|
||||
s = ECDSA_SIG_new();
|
||||
if (s == NULL)
|
||||
return (ret);
|
||||
return ret;
|
||||
if (d2i_ECDSA_SIG(&s, &p, sig_len) == NULL)
|
||||
goto err;
|
||||
/* Ensure signature uses DER and doesn't have trailing garbage */
|
||||
@@ -355,7 +355,7 @@ int ossl_ecdsa_verify(int type, const unsigned char *dgst, int dgst_len,
|
||||
err:
|
||||
OPENSSL_clear_free(der, derlen);
|
||||
ECDSA_SIG_free(s);
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ossl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len,
|
||||
|
||||
Reference in New Issue
Block a user