Skip to content

Commit

Permalink
Clean upp last
Browse files Browse the repository at this point in the history
  • Loading branch information
qpernil committed Feb 8, 2024
1 parent 398697c commit f35d332
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkcs11/yubihsm_pkcs11.c
Original file line number Diff line number Diff line change
Expand Up @@ -5717,7 +5717,6 @@ CK_DEFINE_FUNCTION(CK_RV, C_DeriveKey)
if(out_len > value_len) {
// Truncate from the left
memmove(ecdh_key.ecdh_key, ecdh_key.ecdh_key + out_len - value_len, value_len);
memset(ecdh_key.ecdh_key + value_len, 0, out_len - value_len);
out_len = value_len;
}
}
Expand All @@ -5728,7 +5727,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DeriveKey)
memcpy(ecdh_key.label, label_buf, label_len);
list_append(&session->ecdh_session_keys, &ecdh_key);

insecure_memzero(ecdh_key.ecdh_key, out_len);
insecure_memzero(ecdh_key.ecdh_key, sizeof(ecdh_key.ecdh_key));

*phKey = ecdh_key.id;

Expand Down

0 comments on commit f35d332

Please sign in to comment.