aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Coffman <kwc@citi.umich.edu>2007-06-15 00:09:28 +0000
committerKevin Coffman <kwc@citi.umich.edu>2007-06-15 00:09:28 +0000
commit3cb4b401375adaa687be578ed80ce25ddccce358 (patch)
treed5314aa9e672ed92aa22f0fce83b06d3793be731
parent0623629d90d218ba2d378e3f55fd1adebb33e105 (diff)
downloadkrb5-3cb4b401375adaa687be578ed80ce25ddccce358.zip
krb5-3cb4b401375adaa687be578ed80ce25ddccce358.tar.gz
krb5-3cb4b401375adaa687be578ed80ce25ddccce358.tar.bz2
Fix error returns from ca/crl processing functions
git-svn-id: svn://anonsvn.mit.edu/krb5/users/coffman/pkinit@19578 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/plugins/preauth/pkinit/pkinit_crypto_openssl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
index d3e066e..b359f12 100644
--- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
+++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
@@ -4606,8 +4606,7 @@ load_cas_and_crls(krb5_context context,
}
break;
default:
- retval = ENOTSUP;
- goto cleanup;
+ return ENOTSUP;
}
if (!(in = BIO_new_file(filename, "r"))) {
@@ -4620,6 +4619,7 @@ load_cas_and_crls(krb5_context context,
/* This loads from a file, a stack of x509/crl/pkey sets */
if ((sk = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL)) == NULL) {
pkiDebug("%s: error reading file '%s'\n", __FUNCTION__, filename);
+ retval = EIO;
goto cleanup;
}
@@ -4669,7 +4669,8 @@ load_cas_and_crls(krb5_context context,
}
/* If we added something and there wasn't a stack in the
- * context before, add the temporary stack to the context. */
+ * context before, add the temporary stack to the context.
+ */
switch(catype) {
case CATYPE_ANCHORS:
if (sk_X509_num(ca_certs) == 0) {
@@ -4727,7 +4728,7 @@ load_cas_and_crls_dir(krb5_context context,
int catype,
char *dirname)
{
- krb5_error_code retval = ENOMEM;
+ krb5_error_code retval = EINVAL;
DIR *d = NULL;
struct dirent *dentry = NULL;
char filename[1024];
@@ -4737,7 +4738,7 @@ load_cas_and_crls_dir(krb5_context context,
d = opendir(dirname);
if (d == NULL)
- goto cleanup;
+ return ENOENT;
while ((dentry = readdir(d))) {
if (strlen(dirname) + strlen(dentry->d_name) + 2 > sizeof(filename)) {
@@ -4763,7 +4764,7 @@ load_cas_and_crls_dir(krb5_context context,
retval = 0;
cleanup:
- if (d)
+ if (d != NULL)
closedir(d);
return retval;