VirtualBox

Ignore:
Timestamp:
Sep 4, 2024 12:53:14 PM (9 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/test/sm2_internal_test.c

    r105945 r105949  
    11/*
    2  * Copyright 2017-2024 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
    33 *
    44 * Licensed under the Apache License 2.0 (the "License").  You may not use
     
    306306                         const char *k_hex,
    307307                         const char *r_hex,
    308                          const char *s_hex,
    309                          int omit_pubkey)
     308                         const char *s_hex)
    310309{
    311310    const size_t msg_len = strlen(message);
     
    329328        goto done;
    330329
    331     if (omit_pubkey == 0) {
    332         pt = EC_POINT_new(group);
    333         if (!TEST_ptr(pt)
    334                 || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL))
    335                 || !TEST_true(EC_KEY_set_public_key(key, pt)))
    336             goto done;
    337     }
     330    pt = EC_POINT_new(group);
     331    if (!TEST_ptr(pt)
     332            || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL))
     333            || !TEST_true(EC_KEY_set_public_key(key, pt)))
     334        goto done;
    338335
    339336    start_fake_rand(k_hex);
     
    396393                        "007c47811054c6f99613a578eb8453706ccb96384fe7df5c171671e760bfa8be3a",
    397394                        "40F1EC59F793D9F49E09DCEF49130D4194F79FB1EED2CAA55BACDB49C4E755D1",
    398                         "6FC6DAC32C5D5CF10C77DFB20F7C2EB667A457872FB09EC56327A67EC7DEEBE7", 0)))
    399         goto done;
    400 
    401     /* Make sure we fail if we omit the public portion of the key */
    402     if (!TEST_false(test_sm2_sign(
    403                      test_group,
    404                      /* the default ID specified in GM/T 0009-2012 (Sec. 10).*/
    405                      SM2_DEFAULT_USERID,
    406                      /* privkey */
    407                      "3945208F7B2144B13F36E38AC6D39F95889393692860B51A42FB81EF4DF7C5B8",
    408                      /* plaintext message */
    409                      "message digest",
    410                      /* ephemeral nonce k */
    411                      "59276E27D506861A16680F3AD9C02DCCEF3CC1FA3CDBE4CE6D54B80DEAC1BC21",
    412                      /* expected signature, */
    413                      /* signature R, 0x20 bytes */
    414                      "F5A03B0648D2C4630EEAC513E1BB81A15944DA3827D5B74143AC7EACEEE720B3",
    415                      /* signature S, 0x20 bytes */
    416                      "B1B6AA29DF212FD8763182BC0D421CA1BB9038FD1F7F42D4840B69C485BBC1AA", 1)))
     395                        "6FC6DAC32C5D5CF10C77DFB20F7C2EB667A457872FB09EC56327A67EC7DEEBE7")))
    417396        goto done;
    418397
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