Skip to content

Commit

Permalink
core: Modified to extract DH secret length from modulus instead of pu…
Browse files Browse the repository at this point in the history
…blic key length

Signed-off-by: Katsunori Kikuchi <Katsunori.Kikuchi@sony.com>
  • Loading branch information
TE-0000106830 committed Jul 12, 2023
1 parent a871924 commit 54c317e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/drivers/crypto/crypto_api/acipher/dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ TEE_Result crypto_acipher_dh_shared_secret(struct dh_keypair *private_key,
dh = drvcrypt_get_ops(CRYPTO_DH);
if (dh) {
/* Allocate the binary Secret buffer */
sdata.secret.length = crypto_bignum_num_bytes(public_key);
sdata.secret.length = crypto_bignum_num_bytes(private_key->p);
secret_buf = malloc(sdata.secret.length);
if (!secret_buf)
return TEE_ERROR_OUT_OF_MEMORY;
Expand Down

0 comments on commit 54c317e

Please sign in to comment.