Skip to content

Commit

Permalink
cbs copy change
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemas committed Feb 25, 2025
1 parent 270c74f commit b482db7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crypto/fipsmodule/pqdsa/pqdsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,15 @@ int PQDSA_KEY_set_raw_keypair_from_seed(PQDSA_KEY *key, CBS *in) {
OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR);
return 0;
}

// copy the seed data
OPENSSL_memcpy(seed, CBS_data(in), key->pqdsa->keygen_seed_len);
if (!CBS_copy_bytes(in, seed, key->pqdsa->keygen_seed_len)) {
OPENSSL_free(public_key);
OPENSSL_free(private_key);
OPENSSL_free(seed);
OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR);
return 0;
}

// set the public and private key
key->public_key = public_key;
Expand Down

0 comments on commit b482db7

Please sign in to comment.