mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-09 03:35:40 +00:00
ECP: Increase MBEDTLS_ECP_GRP_OID_MAX_SIZE to 32
Provide documentation for the source of the change
This commit is contained in:
parent
4d092dc42c
commit
4938419f17
|
@ -504,8 +504,14 @@ int mbedtls_ecp_tls_write_group( const mbedtls_ecp_group *grp, size_t *olen,
|
||||||
#if defined(MBEDTLS_ASN1_WRITE_C) && defined(MBEDTLS_OID_C)
|
#if defined(MBEDTLS_ASN1_WRITE_C) && defined(MBEDTLS_OID_C)
|
||||||
/**
|
/**
|
||||||
* \brief Maximum size of the output of mbedtls_ecp_ansi_write_group
|
* \brief Maximum size of the output of mbedtls_ecp_ansi_write_group
|
||||||
|
*
|
||||||
|
* \note The maximum size of the OID of a supported group + 2 for
|
||||||
|
* tag and length. Maximum size 30 is based on the length of
|
||||||
|
* the OID for primeCurves 10-38 over GF(p) defined by the
|
||||||
|
* CDC Group, as they seem to have the longest OID out of
|
||||||
|
* curves in use.
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_OID_EC_GRP_MAX_SIZE 12
|
#define MBEDTLS_ECP_GRP_OID_MAX_SIZE ( 30 + 2 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Write the ANSI X9.62/RFC5480 OID ECParameters of a group
|
* \brief Write the ANSI X9.62/RFC5480 OID ECParameters of a group
|
||||||
|
|
|
@ -282,6 +282,8 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ECParameters namedCurve identifiers, from RFC 5480, RFC 5639, and SEC2
|
* ECParameters namedCurve identifiers, from RFC 5480, RFC 5639, and SEC2
|
||||||
|
* When adding new OID's, please update \c MBEDTLS_ECP_GRP_OID_MAX_SIZE
|
||||||
|
* in ecp.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* secp192r1 OBJECT IDENTIFIER ::= {
|
/* secp192r1 OBJECT IDENTIFIER ::= {
|
||||||
|
|
|
@ -417,8 +417,8 @@ exit:
|
||||||
void ecp_ansi_write_group( int id, char *hex )
|
void ecp_ansi_write_group( int id, char *hex )
|
||||||
{
|
{
|
||||||
mbedtls_ecp_group grp;
|
mbedtls_ecp_group grp;
|
||||||
unsigned char good[MBEDTLS_OID_EC_GRP_MAX_SIZE];
|
unsigned char good[MBEDTLS_ECP_GRP_OID_MAX_SIZE];
|
||||||
unsigned char tested[MBEDTLS_OID_EC_GRP_MAX_SIZE];
|
unsigned char tested[MBEDTLS_ECP_GRP_OID_MAX_SIZE];
|
||||||
size_t good_len = unhexify( good, hex );
|
size_t good_len = unhexify( good, hex );
|
||||||
size_t received_len = 0;
|
size_t received_len = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
Loading…
Reference in a new issue