VirtualBox

Ignore:
Timestamp:
Nov 2, 2022 7:40:16 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154372
Message:

libs: Switch to openssl-3.0.7, bugref:10317

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

Legend:

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

    • Property svn:mergeinfo
      •  

        old new  
        1515/vendor/openssl/3.0.2:150728-150729
        1616/vendor/openssl/3.0.3:151497-151729
        17 /vendor/openssl/current:147554-151496
         17/vendor/openssl/3.0.7:154371
         18/vendor/openssl/current:147554-154370
  • trunk/src/libs/openssl-3.0.7/test/ffc_internal_test.c

    r94320 r97372  
    11/*
    2  * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
    33 * Copyright (c) 2019-2020, Oracle and/or its affiliates.  All rights reserved.
    44 *
     
    2828
    2929#include "internal/ffc.h"
     30#include "crypto/security_bits.h"
    3031
    3132#ifndef OPENSSL_NO_DSA
     
    599600    if (!TEST_false(ossl_ffc_generate_private_key(ctx, params, N + 1, 112, priv)))
    600601        goto err;
     602    /* s must be always set */
     603    if (!TEST_false(ossl_ffc_generate_private_key(ctx, params, N, 0, priv)))
     604        goto err;
    601605    /* pass since 2s <= N <= len(q) */
    602606    if (!TEST_true(ossl_ffc_generate_private_key(ctx, params, N, 112, priv)))
     
    610614    if (!TEST_true(ossl_ffc_validate_private_key(params->q, priv, &res)))
    611615        goto err;
    612 
    613     /* N and s are ignored in this case */
    614     if (!TEST_true(ossl_ffc_generate_private_key(ctx, params, 0, 0, priv)))
     616    /* N is ignored in this case */
     617    if (!TEST_true(ossl_ffc_generate_private_key(ctx, params, 0,
     618                                                 ossl_ifc_ffc_compute_security_bits(BN_num_bits(params->p)),
     619                                                 priv)))
     620        goto err;
     621    if (!TEST_int_le(BN_num_bits(priv), 225))
    615622        goto err;
    616623    if (!TEST_true(ossl_ffc_validate_private_key(params->q, priv, &res)))
     
    622629    BN_free(priv);
    623630    BN_CTX_free(ctx);
     631    return ret;
     632}
     633
     634static int ffc_params_copy_test(void)
     635{
     636    int ret = 0;
     637    DH *dh = NULL;
     638    FFC_PARAMS *params, copy;
     639
     640    ossl_ffc_params_init(&copy);
     641
     642    if (!TEST_ptr(dh = DH_new_by_nid(NID_ffdhe3072)))
     643        goto err;
     644    params = ossl_dh_get0_params(dh);
     645
     646    if (!TEST_int_eq(params->keylength, 275))
     647        goto err;
     648
     649    if (!TEST_true(ossl_ffc_params_copy(&copy, params)))
     650        goto err;
     651
     652    if (!TEST_int_eq(copy.keylength, 275))
     653        goto err;
     654
     655    if (!TEST_true(ossl_ffc_params_cmp(&copy, params, 0)))
     656        goto err;
     657
     658    ret = 1;
     659err:
     660    ossl_ffc_params_cleanup(&copy);
     661    DH_free(dh);
    624662    return ret;
    625663}
     
    639677    ADD_TEST(ffc_private_validate_test);
    640678    ADD_ALL_TESTS(ffc_private_gen_test, 10);
     679    ADD_TEST(ffc_params_copy_test);
    641680#endif /* OPENSSL_NO_DH */
    642681    return 1;
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