TinyCrypt SSL: Declare EC-related TLS RFC constants in SSL namespace

mbedtls/ecp.h defines constants

   MBEDTLS_ECP_PF_UNCOMPRESSED
   MBEDTLS_ECP_PF_COMPRESSED
   MBEDTLS_ECP_TLS_NAMED_CURVE

which regard the encoding of elliptic curves and curve point formats in TLS.
As such, they should be defined in the SSL namespace. Asides, this will help
replacing the legacy ECC crypto by alternative ECC implementations.
This commit is contained in:
Hanno Becker 2019-08-23 14:39:50 +01:00
parent ee902df678
commit 27b7e50dcd
3 changed files with 20 additions and 8 deletions

View file

@ -1885,4 +1885,16 @@ int mbedtls_ssl_ecdh_read_peerkey( mbedtls_ssl_context *ssl,
unsigned char **p, unsigned char *end );
#endif /* MBEDTLS_USE_TINYCRYPT */
/*
* Point formats, from RFC 4492's enum ECPointFormat
*/
#define MBEDTLS_SSL_EC_PF_UNCOMPRESSED 0 /**< Uncompressed point format. */
#define MBEDTLS_SSL_EC_PF_COMPRESSED 1 /**< Compressed point format. */
/*
* Some other constants from RFC 4492
*/
#define MBEDTLS_SSL_EC_TLS_NAMED_CURVE 3 /**< The named_curve of ECCurveType. */
#endif /* ssl_internal.h */