Add support for multiple server certificates
diff --git a/include/polarssl/ssl.h b/include/polarssl/ssl.h
index c764961..f357b46 100644
--- a/include/polarssl/ssl.h
+++ b/include/polarssl/ssl.h
@@ -492,6 +492,9 @@
#if defined(POLARSSL_ECDH_C) || defined(POLARSSL_ECDSA_C)
int ec_curve; /*!< Selected elliptic curve */
#endif
+#if defined(POLARSSL_X509_CRT_PARSE_C)
+ ssl_key_cert *key_cert; /*!< Own key/cert in use */
+#endif
/*
* Checksum contexts
@@ -1517,12 +1520,14 @@
#if defined(POLARSSL_X509_CRT_PARSE_C)
static inline pk_context *ssl_own_key( ssl_context *ssl )
{
- return( ssl->key_cert == NULL ? NULL : ssl->key_cert->key );
+ return( ssl->handshake->key_cert == NULL ? NULL
+ : ssl->handshake->key_cert->key );
}
static inline x509_crt *ssl_own_cert( ssl_context *ssl )
{
- return( ssl->key_cert == NULL ? NULL : ssl->key_cert->cert );
+ return( ssl->handshake->key_cert == NULL ? NULL
+ : ssl->handshake->key_cert->cert );
}
#endif /* POLARSSL_X509_CRT_PARSE_C */