Skip to content

Commit 7511d4a

Browse files
ECP write/export key: document that these functions don't detect unset data
Fixes #8803. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
1 parent 1c7ff7e commit 7511d4a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/mbedtls/ecp.h

+12
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,10 @@ int mbedtls_ecp_read_key(mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
13391339
* See the description of the \p buflen parameter for
13401340
* how to calculate the nominal length.
13411341
*
1342+
* \note If the private key was not set in \p key,
1343+
* the output is unspecified. Future versions
1344+
* may return an error in that case.
1345+
*
13421346
* \param key The private key.
13431347
* \param buf The output buffer for containing the binary representation
13441348
* of the key.
@@ -1369,6 +1373,10 @@ int mbedtls_ecp_write_key(mbedtls_ecp_keypair *key,
13691373
/**
13701374
* \brief This function exports an elliptic curve public key.
13711375
*
1376+
* \note If the public key was not set in \p key,
1377+
* the output is unspecified. Future versions
1378+
* may return an error in that case.
1379+
*
13721380
* \param key The public key.
13731381
* \param format The point format. This must be either
13741382
* #MBEDTLS_ECP_PF_COMPRESSED or #MBEDTLS_ECP_PF_UNCOMPRESSED.
@@ -1451,6 +1459,10 @@ mbedtls_ecp_group_id mbedtls_ecp_keypair_get_group_id(
14511459
* Each of the output parameters can be a null pointer
14521460
* if you do not need that parameter.
14531461
*
1462+
* \note If the private key or the public key was not set in \p key,
1463+
* the corresponding output is unspecified. Future versions
1464+
* may return an error in that case.
1465+
*
14541466
* \param key The key pair to export from.
14551467
* \param grp Slot for exported ECP group.
14561468
* It must either be null or point to an initialized ECP group.

0 commit comments

Comments
 (0)