diff options
author | Eduardo Chappa <chappa@washington.edu> | 2016-10-08 10:01:01 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2016-10-08 10:01:01 -0600 |
commit | 59678f8c7af17eb361f4b9cc9c30a26bff01a1f3 (patch) | |
tree | aa42ff0face7b1c65003e055656370e6136e1ae4 /pith/smime.c | |
parent | b3cae4deb342505d445af54093c39b0d3a7a8f28 (diff) | |
download | alpine-59678f8c7af17eb361f4b9cc9c30a26bff01a1f3.tar.xz |
* Some code clean up before releasing the next alpha version.
Diffstat (limited to 'pith/smime.c')
-rw-r--r-- | pith/smime.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/pith/smime.c b/pith/smime.c index d219ba03..43e7375b 100644 --- a/pith/smime.c +++ b/pith/smime.c @@ -225,7 +225,7 @@ setup_pwdcert(void **pwdcert) EVP_PKEY *pkey = NULL; X509 *pcert = NULL; PERSONAL_CERT *pc, *pc2 = NULL; - static int was_here = 0, setup_certdir = 0; + static int was_here = 0; if(pwdcert == NULL || was_here == 1) return -1; @@ -262,8 +262,14 @@ setup_pwdcert(void **pwdcert) } if(ps_global->pwdcertdir == NULL){ /* save the result of pwdcertdir */ - setup_certdir = 1; ps_global->pwdcertdir = cpystr(pathdir); + /* if the user gave a pwdcertdir and there is nothing there, do not + * continue. Let the user initialize on their own this directory. + */ + if(certfile == NULL || keyfile == NULL){ + was_here = 0; + return -5; + } } if(certfile && keyfile){ @@ -278,14 +284,6 @@ setup_pwdcert(void **pwdcert) return 0; } - /* if the user gave a pwdcertdir and there is nothing there, do not - * continue. Let the user initialize on their own this directory. - */ - if(setup_certdir){ /* if we are here, pwdcertdir failed */ - was_here = 0; - return -5; - } - /* look to see if there are any certificates lying around, first * we try to load ps_global->smime to see if that has information * we can use. If we are the process filling the smime structure |