VirtualBox

Ignore:
Timestamp:
Sep 4, 2024 12:53:14 PM (6 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164683
Message:

openssl-3.1.7: Applied and adjusted our OpenSSL changes to 3.1.7. bugref:10757

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/openssl-3.1.7/crypto/ec/ecdsa_ossl.c

    r105945 r105949  
    11/*
    2  * Copyright 2002-2024 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
    33 *
    44 * Licensed under the Apache License 2.0 (the "License").  You may not use
     
    7171    ECDSA_SIG *s;
    7272
    73     if (sig == NULL && (kinv == NULL || r == NULL)) {
    74         *siglen = ECDSA_size(eckey);
    75         return 1;
    76     }
    77 
    7873    s = ECDSA_do_sign_ex(dgst, dlen, kinv, r, eckey);
    7974    if (s == NULL) {
     
    131126        goto err;
    132127    }
    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);
    138129
    139130    /* Preallocate space */
     
    150141        do {
    151142            if (dgst != NULL) {
    152                 if (!ossl_bn_gen_dsa_nonce_fixed_top(k, order, priv_key,
    153                                                      dgst, dlen, ctx)) {
     143                if (!BN_generate_dsa_nonce(k, order, priv_key,
     144                                           dgst, dlen, ctx)) {
    154145                    ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED);
    155146                    goto err;
    156147                }
    157148            } 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)) {
    159150                    ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED);
    160151                    goto err;
    161152                }
    162153            }
    163         } while (ossl_bn_is_word_fixed_top(k, 0));
     154        } while (BN_is_zero(k));
    164155
    165156        /* compute r the x-coordinate of generator * k */
     
    260251    }
    261252
    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);
    267254    i = BN_num_bits(order);
    268255    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette