Add configuration handling for certificate and key files.
authorjsing <jsing@openbsd.org>
Sun, 13 Jul 2014 23:54:52 +0000 (23:54 +0000)
committerjsing <jsing@openbsd.org>
Sun, 13 Jul 2014 23:54:52 +0000 (23:54 +0000)
lib/libressl/ressl.h
lib/libressl/ressl_config.c
lib/libressl/ressl_internal.h

index dc99368..d4962f3 100644 (file)
@@ -29,7 +29,9 @@ void ressl_config_free(struct ressl_config *config);
 
 void ressl_config_set_ca_file(struct ressl_config *config, char *ca_file);
 void ressl_config_set_ca_path(struct ressl_config *config, char *ca_path);
+void ressl_config_set_cert_file(struct ressl_config *config, char *cert_file);
 void ressl_config_set_ciphers(struct ressl_config *config, char *ciphers);
+void ressl_config_set_key_file(struct ressl_config *config, char *key_file);
 void ressl_config_set_verify_depth(struct ressl_config *config,
     int verify_depth);
 
index 6205b6c..1509b5a 100644 (file)
@@ -63,21 +63,21 @@ ressl_config_set_ca_path(struct ressl_config *config, char *ca_path)
 }
 
 void
-ressl_config_set_ciphers(struct ressl_config *config, char *ciphers)
+ressl_config_set_cert_file(struct ressl_config *config, char *cert_file)
 {
-       config->ciphers = ciphers;
+       config->cert_file = cert_file;
 }
 
 void
-ressl_config_insecure_no_verify(struct ressl_config *config)
+ressl_config_set_ciphers(struct ressl_config *config, char *ciphers)
 {
-       config->verify = 0;
+       config->ciphers = ciphers;
 }
 
 void
-ressl_config_verify(struct ressl_config *config)
+ressl_config_set_key_file(struct ressl_config *config, char *key_file)
 {
-       config->verify = 1;
+       config->key_file = key_file;
 }
 
 void
@@ -85,3 +85,15 @@ ressl_config_set_verify_depth(struct ressl_config *config, int verify_depth)
 {
        config->verify_depth = verify_depth;
 }
+
+void
+ressl_config_insecure_no_verify(struct ressl_config *config)
+{
+       config->verify = 0;
+}
+
+void
+ressl_config_verify(struct ressl_config *config)
+{
+       config->verify = 1;
+}
index c234153..c33d4cf 100644 (file)
@@ -27,8 +27,9 @@
 struct ressl_config {
        const char *ca_file;
        const char *ca_path;
+       const char *cert_file;
        const char *ciphers;
-       const char *server_name;
+       const char *key_file;
        int verify;
        int verify_depth;
 };