Skip to content

Commit

Permalink
ecc: implement get_params for ENCODED_PUBLIC_KEY
Browse files Browse the repository at this point in the history
Implement get_params for OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY since this
is required for OpenSSL's TLS implementation.

Signed-off-by: Rob Shearman <[email protected]>
  • Loading branch information
rshearman authored and gotthardp committed Aug 14, 2023
1 parent c0afc49 commit d872a09
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tpm2-provider-keymgmt-ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ tpm2_ec_keymgmt_get_params(void *keydata, OSSL_PARAM params[])
p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_Y);
if (p != NULL && !tpm2_param_set_BN_from_buffer(p, pkey->data.pub.publicArea.unique.ecc.y))
goto error;
p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY);
if (p != NULL && !tpm2_param_set_ecc_point(p, &pkey->data.pub.publicArea.unique.ecc.x,
&pkey->data.pub.publicArea.unique.ecc.y))
goto error;
free(details);
return 1;
error:
Expand Down Expand Up @@ -450,6 +454,7 @@ tpm2_ec_keymgmt_gettable_params(void *provctx)
OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_PUB_KEY, NULL, 0),
OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_X, NULL, 0),
OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_Y, NULL, 0),
OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0),
OSSL_PARAM_END
};

Expand Down

0 comments on commit d872a09

Please sign in to comment.