Update OpenSSL-1.1.1-pre9-dev
This commit is contained in:
@@ -288,7 +288,7 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
|
||||
*
|
||||
* We will blind this to protect against side channel attacks
|
||||
*
|
||||
* s := k^-1 * blind^-1 * (blind * m + blind * r * priv_key) mod order
|
||||
* s := blind^-1 * k^-1 * (blind * m + blind * r * priv_key) mod order
|
||||
*/
|
||||
|
||||
/* Generate a blinding value */
|
||||
@@ -323,6 +323,12 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* s := s * k^-1 mod order */
|
||||
if (!BN_mod_mul(s, s, ckinv, order, ctx)) {
|
||||
ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* s:= s * blind^-1 mod order */
|
||||
if (BN_mod_inverse(blind, blind, order, ctx) == NULL) {
|
||||
ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
|
||||
@@ -333,12 +339,6 @@ ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* s := s * k^-1 mod order */
|
||||
if (!BN_mod_mul(s, s, ckinv, order, ctx)) {
|
||||
ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (BN_is_zero(s)) {
|
||||
/*
|
||||
* if kinv and r have been supplied by the caller, don't
|
||||
|
||||
Reference in New Issue
Block a user