[tls] Use our own ASN.1 routines for certificate parsing

Use our own, more robust, ASN.1 parsing routines to extract the RSA
public key from a server certificate.  Remove the now-unused AXTLS
ASN.1 parser.
This commit is contained in:
Michael Brown
2009-02-10 18:30:17 +00:00
parent 5a99c586cf
commit 8e960eb67c
8 changed files with 353 additions and 953 deletions
+39
View File
@@ -0,0 +1,39 @@
#ifndef _GPXE_X509_H
#define _GPXE_X509_H
/** @file
*
* X.509 certificates
*
*/
#include <stdint.h>
struct asn1_cursor;
/** An X.509 RSA public key */
struct x509_rsa_public_key {
/** Modulus */
uint8_t *modulus;
/** Modulus length */
size_t modulus_len;
/** Exponent */
uint8_t *exponent;
/** Exponent length */
size_t exponent_len;
};
/**
* Free X.509 RSA public key
*
* @v rsa_pubkey RSA public key
*/
static inline void
x509_free_rsa_public_key ( struct x509_rsa_public_key *rsa_pubkey ) {
free ( rsa_pubkey->modulus );
}
extern int x509_rsa_public_key ( const struct asn1_cursor *certificate,
struct x509_rsa_public_key *rsa_pubkey );
#endif /* _GPXE_X509_H */