diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-04 14:39:57 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-11 12:12:23 +0100 |
commit | c48ffbcca1d0213c6bcbe85de7bb5dd23c76438d (patch) | |
tree | bcc8cd093087c7c10c681f343e4b072588430416 /ssl/ssl_mcnf.c | |
parent | SSL: refactor ossl_statem_fatal() and SSLfatal() (diff) | |
download | openssl-c48ffbcca1d0213c6bcbe85de7bb5dd23c76438d.tar.xz openssl-c48ffbcca1d0213c6bcbe85de7bb5dd23c76438d.zip |
SSL: refactor all SSLfatal() calls
Since SSLfatal() doesn't take a function code any more, we drop that
argument everywhere. Also, we convert all combinations of SSLfatal()
and ERR_add_data() to an SSLfatal_data() call.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13316)
Diffstat (limited to 'ssl/ssl_mcnf.c')
-rw-r--r-- | ssl/ssl_mcnf.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/ssl/ssl_mcnf.c b/ssl/ssl_mcnf.c index 2b8ef12592..c2366e41e3 100644 --- a/ssl/ssl_mcnf.c +++ b/ssl/ssl_mcnf.c @@ -39,10 +39,9 @@ static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name, int system) if (name == NULL && system) name = "system_default"; if (!conf_ssl_name_find(name, &idx)) { - if (!system) { - ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME); - ERR_add_error_data(2, "name=", name); - } + if (!system) + ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME, + "name=%s", name); goto err; } cmds = conf_ssl_get(idx, &name, &cmd_count); @@ -73,12 +72,10 @@ static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name, int system) conf_ssl_get_cmd(cmds, i, &cmdstr, &arg); rv = SSL_CONF_cmd(cctx, cmdstr, arg); if (rv <= 0) { - if (rv == -2) - ERR_raise(ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND); - else - ERR_raise(ERR_LIB_SSL, SSL_R_BAD_VALUE); - ERR_add_error_data(6, "section=", name, ", cmd=", cmdstr, - ", arg=", arg); + int errcode = rv == -2 ? SSL_R_UNKNOWN_COMMAND : SSL_R_BAD_VALUE; + + ERR_raise_data(ERR_LIB_SSL, errcode, + "section=%s, cmd=%s, arg=%s", name, cmdstr, arg); goto err; } } |