From: jsing Date: Sun, 13 Jul 2014 23:54:52 +0000 (+0000) Subject: Add configuration handling for certificate and key files. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c636fe6a786b10ec9d2ed659c1e14a6f83fd1ce9;p=openbsd Add configuration handling for certificate and key files. --- diff --git a/lib/libressl/ressl.h b/lib/libressl/ressl.h index dc99368fe67..d4962f358b6 100644 --- a/lib/libressl/ressl.h +++ b/lib/libressl/ressl.h @@ -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); diff --git a/lib/libressl/ressl_config.c b/lib/libressl/ressl_config.c index 6205b6c5597..1509b5aeba3 100644 --- a/lib/libressl/ressl_config.c +++ b/lib/libressl/ressl_config.c @@ -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; +} diff --git a/lib/libressl/ressl_internal.h b/lib/libressl/ressl_internal.h index c2341535877..c33d4cff2e2 100644 --- a/lib/libressl/ressl_internal.h +++ b/lib/libressl/ressl_internal.h @@ -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; };