From 991d0f5aca0576a7561f2f63adf4d432bd0388c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 11 Jul 2013 11:14:55 +0200 Subject: [PATCH] Remove rsa member from x509_cert structure --- include/polarssl/x509.h | 1 - library/x509parse.c | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/include/polarssl/x509.h b/include/polarssl/x509.h index 24e345356..47b5ab85b 100644 --- a/include/polarssl/x509.h +++ b/include/polarssl/x509.h @@ -212,7 +212,6 @@ typedef struct _x509_cert x509_time valid_to; /**< End time of certificate validity. */ pk_context pk; /**< Container for the public key context. */ - rsa_context rsa; /**< Container for the RSA context. Kept for compatibility while transitioning to generic PK */ x509_buf issuer_id; /**< Optional X.509 v2/v3 issuer unique identifier. */ x509_buf subject_id; /**< Optional X.509 v2/v3 subject unique identifier. */ diff --git a/library/x509parse.c b/library/x509parse.c index 6c848b7ab..f03652694 100644 --- a/library/x509parse.c +++ b/library/x509parse.c @@ -1422,17 +1422,6 @@ static int x509parse_crt_der_core( x509_cert *crt, const unsigned char *buf, return( ret ); } - /* - * Temporary hack for compatibility while transitioning to PK abstraction - * (Cannot use rsa_wrap above since it would force RSA key type.) - */ - if( crt->pk.type == POLARSSL_PK_RSA ) { - memcpy( &crt->rsa, pk_rsa( crt->pk ), sizeof( rsa_context ) ); - free( crt->pk.data ); - crt->pk.data = &crt->rsa; - crt->pk.dont_free = 1; - } - /* * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, * -- If present, version shall be v2 or v3 @@ -4011,7 +4000,6 @@ void x509_free( x509_cert *crt ) do { pk_free( &cert_cur->pk ); - rsa_free( &cert_cur->rsa ); name_cur = cert_cur->issuer.next; while( name_cur != NULL )