Skip to content

Commit

Permalink
EC keys: vendor optimization where private key may contain CKA_EC_POINT
Browse files Browse the repository at this point in the history
Signed-off-by: S-P Chan <[email protected]>
  • Loading branch information
space88man committed Feb 22, 2024
1 parent 41a049e commit e0bae67
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,14 @@ static int match_public_keys(P11PROV_OBJ *key1, P11PROV_OBJ *key2)
return cmp_public_key_values(key1, key2);
}

if (key1->data.key.type == CKK_EC) {
/* Vendor implementation where EC private key may contain
* CKA_EC_POINT
*/
ret = cmp_public_key_values(key1, key2);
if (ret != RET_OSSL_ERR) return ret;
}

/* one of the keys or both are private */
if (key1->class == CKO_PUBLIC_KEY && key2->class == CKO_PRIVATE_KEY) {
pub_key = key1;
Expand Down

0 comments on commit e0bae67

Please sign in to comment.