/* The following code is used for loading multiple crt files into
* SSL_CTX's based on CN/SAN
*/
-#if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
/* This is used to preload the certifcate, private key
* and Cert Chain of a file passed in via the crt
* argument
*/
struct eb_root ckchn_tree = EB_ROOT_UNIQUE;
+#if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
+
#define SSL_SOCK_POSSIBLE_KT_COMBOS (1<<(SSL_SOCK_NUM_KEYTYPES))
struct key_combo_ctx {
struct ebmb_node name; /* node holding the servername value */
};
+#endif
/* Loads Diffie-Hellman parameter from a ckchn. Returns 1 if loaded, else -1
if an error occurred, and 0 if parameter not found. */
return 0;
}
+#if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
static void ssl_sock_populate_sni_keytypes_hplr(const char *str, struct eb_root *sni_keytypes, int key_index)
{
}
+#endif
+
/*
* lookup a path into the ckchn tree.
*/
static struct ckch_node *ckchn_load_cert_file(char *path, int multi, char **err)
{
struct ckch_node *ckchn;
- char fp[MAXPATHLEN+1] = {0};
- int n = 0;
ckchn = calloc(1, sizeof(*ckchn) + strlen(path) + 1);
if (!ckchn) {
ebst_insert(&ckchn_tree, &ckchn->node);
} else {
int found = 0;
+#if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
+ char fp[MAXPATHLEN+1] = {0};
+ int n = 0;
/* Load all possible certs and keys */
for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++) {
ckchn->multi = 1;
}
}
+#endif
if (!found) {
memprintf(err, "%sDidn't find any certificate.\n", err && *err ? *err : "");
return NULL;
}
+#if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
+
/*
* Take a ckch_node which contains a multi-certificate bundle.
* Group these certificates into a set of SSL_CTX*