Add EC support to x509write_pubkey
This commit is contained in:
parent
e1f821a6eb
commit
3837daec9e
6 changed files with 111 additions and 10 deletions
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "asn1.h"
|
||||
|
||||
#define ASN1_CHK_ADD(g, f) if( ( ret = f ) < 0 ) return( ret ); else g += ret
|
||||
#define ASN1_CHK_ADD(g, f) do { if( ( ret = f ) < 0 ) return( ret ); else g += ret; } while( 0 )
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -133,6 +133,7 @@ ecp_keypair;
|
|||
*/
|
||||
#define POLARSSL_ECP_MAX_BITS 521
|
||||
#define POLARSSL_ECP_MAX_BYTES ( ( POLARSSL_ECP_MAX_BITS + 7 ) / 8 )
|
||||
#define POLARSSL_ECP_MAX_PT_LEN ( 2 * POLARSSL_ECP_MAX_BYTES + 1 )
|
||||
|
||||
/*
|
||||
* Maximum window size (actually, NAF width) used for point multipliation.
|
||||
|
|
|
@ -370,8 +370,9 @@ int oid_get_attr_short_name( const asn1_buf *oid, const char **short_name );
|
|||
*/
|
||||
int oid_get_pk_alg( const asn1_buf *oid, pk_type_t *pk_alg );
|
||||
|
||||
#if defined(POLARSSL_ECP_C)
|
||||
/**
|
||||
* \brief Translate ECParameters OID into an EC group identifier
|
||||
* \brief Translate NamedCurve OID into an EC group identifier
|
||||
*
|
||||
* \param oid OID to use
|
||||
* \param grp_id place to store group id
|
||||
|
@ -380,6 +381,19 @@ int oid_get_pk_alg( const asn1_buf *oid, pk_type_t *pk_alg );
|
|||
*/
|
||||
int oid_get_ec_grp( const asn1_buf *oid, ecp_group_id *grp_id );
|
||||
|
||||
/**
|
||||
* \brief Translate EC group identifier into NamedCurve OID
|
||||
*
|
||||
* \param grp_id EC group identifier
|
||||
* \param oid place to store ASN.1 OID string pointer
|
||||
* \param olen length of the OID
|
||||
*
|
||||
* \return 0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
|
||||
*/
|
||||
int oid_get_oid_by_ec_grp( ecp_group_id grp_id,
|
||||
const char **oid, size_t *olen );
|
||||
#endif /* POLARSSL_ECP_C */
|
||||
|
||||
#if defined(POLARSSL_MD_C)
|
||||
/**
|
||||
* \brief Translate SignatureAlgorithm OID into md_type and pk_type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue