Changeset 105949 in vbox for trunk/src/libs/openssl-3.1.7/crypto/ec/ecdsa_ossl.c
- Timestamp:
- Sep 4, 2024 12:53:14 PM (6 months ago)
- svn:sync-xref-src-repo-rev:
- 164683
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/openssl-3.1.7/crypto/ec/ecdsa_ossl.c
r105945 r105949 1 1 /* 2 * Copyright 2002-202 4The OpenSSL Project Authors. All Rights Reserved.2 * Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved. 3 3 * 4 4 * Licensed under the Apache License 2.0 (the "License"). You may not use … … 71 71 ECDSA_SIG *s; 72 72 73 if (sig == NULL && (kinv == NULL || r == NULL)) {74 *siglen = ECDSA_size(eckey);75 return 1;76 }77 78 73 s = ECDSA_do_sign_ex(dgst, dlen, kinv, r, eckey); 79 74 if (s == NULL) { … … 131 126 goto err; 132 127 } 133 134 if ((order = EC_GROUP_get0_order(group)) == NULL) { 135 ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB); 136 goto err; 137 } 128 order = EC_GROUP_get0_order(group); 138 129 139 130 /* Preallocate space */ … … 150 141 do { 151 142 if (dgst != NULL) { 152 if (! ossl_bn_gen_dsa_nonce_fixed_top(k, order, priv_key,153 143 if (!BN_generate_dsa_nonce(k, order, priv_key, 144 dgst, dlen, ctx)) { 154 145 ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED); 155 146 goto err; 156 147 } 157 148 } else { 158 if (! ossl_bn_priv_rand_range_fixed_top(k, order, 0, ctx)) {149 if (!BN_priv_rand_range_ex(k, order, 0, ctx)) { 159 150 ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED); 160 151 goto err; 161 152 } 162 153 } 163 } while ( ossl_bn_is_word_fixed_top(k, 0));154 } while (BN_is_zero(k)); 164 155 165 156 /* compute r the x-coordinate of generator * k */ … … 260 251 } 261 252 262 if ((order = EC_GROUP_get0_order(group)) == NULL) { 263 ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB); 264 goto err; 265 } 266 253 order = EC_GROUP_get0_order(group); 267 254 i = BN_num_bits(order); 268 255 /*
Note:
See TracChangeset
for help on using the changeset viewer.