SSL_TLS doesn't depend on PK any more
(But PK does depend on RSA or ECP.)
diff --git a/include/polarssl/config.h b/include/polarssl/config.h
index 34daaa1..890f306 100644
--- a/include/polarssl/config.h
+++ b/include/polarssl/config.h
@@ -1194,11 +1194,12 @@
* Enable the generic public (asymetric) key layer.
*
* Module: library/pk.c
- * Caller: library/x509parse.c
- * library/ssl_tls.c
+ * Caller: library/ssl_tls.c
* library/ssl_cli.c
* library/ssl_srv.c
*
+ * Requires: POLARSSL_RSA_C or POLARSSL_ECP_C
+ *
* Uncomment to enable generic public key wrappers.
*/
#define POLARSSL_PK_C
@@ -1385,7 +1386,7 @@
* Caller: library/ssl_cli.c
* library/ssl_srv.c
*
- * Requires: POLARSSL_CIPHER_C, POLARSSL_PK_C, POLARSSL_MD_C
+ * Requires: POLARSSL_CIPHER_C, POLARSSL_MD_C
* and at least one of the POLARSSL_SSL_PROTO_* defines
*
* This module is required for SSL/TLS.
@@ -1708,7 +1709,7 @@
#endif
#if defined(POLARSSL_SSL_TLS_C) && ( !defined(POLARSSL_CIPHER_C) || \
- !defined(POLARSSL_PK_C) || !defined(POLARSSL_MD_C) )
+ !defined(POLARSSL_MD_C) )
#error "POLARSSL_SSL_TLS_C defined, but not all prerequisites"
#endif
diff --git a/include/polarssl/ssl.h b/include/polarssl/ssl.h
index d9e98a4..98742dc 100644
--- a/include/polarssl/ssl.h
+++ b/include/polarssl/ssl.h
@@ -649,8 +649,10 @@
/*
* PKI layer
*/
+#if defined(POLARSSL_PK_C)
pk_context *pk_key; /*!< own private key */
int pk_key_own_alloc; /*!< did we allocate pk_key? */
+#endif
#if defined(POLARSSL_X509_CRT_PARSE_C)
x509_crt *own_cert; /*!< own X.509 certificate */
@@ -1493,8 +1495,11 @@
void ssl_optimize_checksum( ssl_context *ssl, const ssl_ciphersuite_t *ciphersuite_info );
+#if defined(POLARSSL_PK_C)
unsigned char ssl_sig_from_pk( pk_context *pk );
pk_type_t ssl_pk_alg_from_sig( unsigned char sig );
+#endif
+
md_type_t ssl_md_alg_from_hash( unsigned char hash );
#ifdef __cplusplus
diff --git a/include/polarssl/ssl_ciphersuites.h b/include/polarssl/ssl_ciphersuites.h
index 62a41ec..73d6260 100644
--- a/include/polarssl/ssl_ciphersuites.h
+++ b/include/polarssl/ssl_ciphersuites.h
@@ -197,7 +197,9 @@
const ssl_ciphersuite_t *ssl_ciphersuite_from_string( const char *ciphersuite_name );
const ssl_ciphersuite_t *ssl_ciphersuite_from_id( int ciphersuite_id );
+#if defined(POLARSSL_PK_C)
pk_type_t ssl_get_ciphersuite_sig_pk_alg( const ssl_ciphersuite_t *info );
+#endif
int ssl_ciphersuite_uses_ec( const ssl_ciphersuite_t *info );