VirtualBox

Ignore:
Timestamp:
Mar 3, 2022 7:17:34 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150325
Message:

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

Location:
trunk/src/libs/openssl-3.0.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/openssl-3.0.1

    • Property svn:mergeinfo
      •  

        old new  
        1212/vendor/openssl/1.1.1c:131722-131725
        1313/vendor/openssl/1.1.1k:145841-145843
         14/vendor/openssl/3.0.1:150323-150324
         15/vendor/openssl/current:147554-150322
  • trunk/src/libs/openssl-3.0.1/crypto/ec/ecp_nist.c

    r91772 r94082  
    11/*
    2  * Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
    33 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
    44 *
    5  * Licensed under the OpenSSL license (the "License").  You may not use
     5 * Licensed under the Apache License 2.0 (the "License").  You may not use
    66 * this file except in compliance with the License.  You can obtain a copy
    77 * in the file LICENSE in the source distribution or at
    88 * https://www.openssl.org/source/license.html
    99 */
     10
     11/*
     12 * ECDSA low level APIs are deprecated for public use, but still ok for
     13 * internal use.
     14 */
     15#include "internal/deprecated.h"
    1016
    1117#include <limits.h>
     
    2026        EC_FLAGS_DEFAULT_OCT,
    2127        NID_X9_62_prime_field,
    22         ec_GFp_simple_group_init,
    23         ec_GFp_simple_group_finish,
    24         ec_GFp_simple_group_clear_finish,
    25         ec_GFp_nist_group_copy,
    26         ec_GFp_nist_group_set_curve,
    27         ec_GFp_simple_group_get_curve,
    28         ec_GFp_simple_group_get_degree,
    29         ec_group_simple_order_bits,
    30         ec_GFp_simple_group_check_discriminant,
    31         ec_GFp_simple_point_init,
    32         ec_GFp_simple_point_finish,
    33         ec_GFp_simple_point_clear_finish,
    34         ec_GFp_simple_point_copy,
    35         ec_GFp_simple_point_set_to_infinity,
    36         ec_GFp_simple_set_Jprojective_coordinates_GFp,
    37         ec_GFp_simple_get_Jprojective_coordinates_GFp,
    38         ec_GFp_simple_point_set_affine_coordinates,
    39         ec_GFp_simple_point_get_affine_coordinates,
     28        ossl_ec_GFp_simple_group_init,
     29        ossl_ec_GFp_simple_group_finish,
     30        ossl_ec_GFp_simple_group_clear_finish,
     31        ossl_ec_GFp_nist_group_copy,
     32        ossl_ec_GFp_nist_group_set_curve,
     33        ossl_ec_GFp_simple_group_get_curve,
     34        ossl_ec_GFp_simple_group_get_degree,
     35        ossl_ec_group_simple_order_bits,
     36        ossl_ec_GFp_simple_group_check_discriminant,
     37        ossl_ec_GFp_simple_point_init,
     38        ossl_ec_GFp_simple_point_finish,
     39        ossl_ec_GFp_simple_point_clear_finish,
     40        ossl_ec_GFp_simple_point_copy,
     41        ossl_ec_GFp_simple_point_set_to_infinity,
     42        ossl_ec_GFp_simple_point_set_affine_coordinates,
     43        ossl_ec_GFp_simple_point_get_affine_coordinates,
    4044        0, 0, 0,
    41         ec_GFp_simple_add,
    42         ec_GFp_simple_dbl,
    43         ec_GFp_simple_invert,
    44         ec_GFp_simple_is_at_infinity,
    45         ec_GFp_simple_is_on_curve,
    46         ec_GFp_simple_cmp,
    47         ec_GFp_simple_make_affine,
    48         ec_GFp_simple_points_make_affine,
     45        ossl_ec_GFp_simple_add,
     46        ossl_ec_GFp_simple_dbl,
     47        ossl_ec_GFp_simple_invert,
     48        ossl_ec_GFp_simple_is_at_infinity,
     49        ossl_ec_GFp_simple_is_on_curve,
     50        ossl_ec_GFp_simple_cmp,
     51        ossl_ec_GFp_simple_make_affine,
     52        ossl_ec_GFp_simple_points_make_affine,
    4953        0 /* mul */ ,
    5054        0 /* precompute_mult */ ,
    5155        0 /* have_precompute_mult */ ,
    52         ec_GFp_nist_field_mul,
    53         ec_GFp_nist_field_sqr,
     56        ossl_ec_GFp_nist_field_mul,
     57        ossl_ec_GFp_nist_field_sqr,
    5458        0 /* field_div */ ,
    55         ec_GFp_simple_field_inv,
     59        ossl_ec_GFp_simple_field_inv,
    5660        0 /* field_encode */ ,
    5761        0 /* field_decode */ ,
    5862        0,                      /* field_set_to_one */
    59         ec_key_simple_priv2oct,
    60         ec_key_simple_oct2priv,
     63        ossl_ec_key_simple_priv2oct,
     64        ossl_ec_key_simple_oct2priv,
    6165        0, /* set private */
    62         ec_key_simple_generate_key,
    63         ec_key_simple_check_key,
    64         ec_key_simple_generate_public_key,
     66        ossl_ec_key_simple_generate_key,
     67        ossl_ec_key_simple_check_key,
     68        ossl_ec_key_simple_generate_public_key,
    6569        0, /* keycopy */
    6670        0, /* keyfinish */
    67         ecdh_simple_compute_key,
     71        ossl_ecdh_simple_compute_key,
     72        ossl_ecdsa_simple_sign_setup,
     73        ossl_ecdsa_simple_sign_sig,
     74        ossl_ecdsa_simple_verify_sig,
    6875        0, /* field_inverse_mod_ord */
    69         ec_GFp_simple_blind_coordinates,
    70         ec_GFp_simple_ladder_pre,
    71         ec_GFp_simple_ladder_step,
    72         ec_GFp_simple_ladder_post
     76        ossl_ec_GFp_simple_blind_coordinates,
     77        ossl_ec_GFp_simple_ladder_pre,
     78        ossl_ec_GFp_simple_ladder_step,
     79        ossl_ec_GFp_simple_ladder_post
    7380    };
    7481
     
    7683}
    7784
    78 int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)
     85int ossl_ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)
    7986{
    8087    dest->field_mod_func = src->field_mod_func;
    8188
    82     return ec_GFp_simple_group_copy(dest, src);
     89    return ossl_ec_GFp_simple_group_copy(dest, src);
    8390}
    8491
    85 int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p,
    86                                 const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
     92int ossl_ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p,
     93                                     const BIGNUM *a, const BIGNUM *b,
     94                                     BN_CTX *ctx)
    8795{
    8896    int ret = 0;
     
    9098
    9199    if (ctx == NULL)
    92         if ((ctx = new_ctx = BN_CTX_new()) == NULL)
     100        if ((ctx = new_ctx = BN_CTX_new_ex(group->libctx)) == NULL)
    93101            return 0;
    94102
     
    106114        group->field_mod_func = BN_nist_mod_521;
    107115    else {
    108         ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE, EC_R_NOT_A_NIST_PRIME);
     116        ERR_raise(ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME);
    109117        goto err;
    110118    }
    111119
    112     ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
     120    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
    113121
    114122 err:
     
    118126}
    119127
    120 int ec_GFp_nist_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
    121                           const BIGNUM *b, BN_CTX *ctx)
     128int ossl_ec_GFp_nist_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
     129                               const BIGNUM *b, BN_CTX *ctx)
    122130{
    123131    int ret = 0;
     
    125133
    126134    if (!group || !r || !a || !b) {
    127         ECerr(EC_F_EC_GFP_NIST_FIELD_MUL, ERR_R_PASSED_NULL_PARAMETER);
     135        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
    128136        goto err;
    129137    }
    130138    if (!ctx)
    131         if ((ctx_new = ctx = BN_CTX_new()) == NULL)
     139        if ((ctx_new = ctx = BN_CTX_new_ex(group->libctx)) == NULL)
    132140            goto err;
    133141
     
    143151}
    144152
    145 int ec_GFp_nist_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
    146                           BN_CTX *ctx)
     153int ossl_ec_GFp_nist_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
     154                               BN_CTX *ctx)
    147155{
    148156    int ret = 0;
     
    150158
    151159    if (!group || !r || !a) {
    152         ECerr(EC_F_EC_GFP_NIST_FIELD_SQR, EC_R_PASSED_NULL_PARAMETER);
     160        ERR_raise(ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER);
    153161        goto err;
    154162    }
    155163    if (!ctx)
    156         if ((ctx_new = ctx = BN_CTX_new()) == NULL)
     164        if ((ctx_new = ctx = BN_CTX_new_ex(group->libctx)) == NULL)
    157165            goto err;
    158166
Note: See TracChangeset for help on using the changeset viewer.

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