summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2013-11-14 12:38:21 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2013-11-14 12:38:21 +0000
commitea7417b4f0c245c1c5f71168b9ed42ef99902785 (patch)
treeaf2cdda98931af5f20fbf0392a022b0493cb5e8f /sbin
parented458f8aea072af4bd85ade9f5872e76133fceb3 (diff)
pass caller to ca_sslerror for better error messages; ok mikeb
Diffstat (limited to 'sbin')
-rw-r--r--sbin/iked/ca.c14
-rw-r--r--sbin/iked/crypto.c10
-rw-r--r--sbin/iked/iked.h4
3 files changed, 14 insertions, 14 deletions
diff --git a/sbin/iked/ca.c b/sbin/iked/ca.c
index d3599994bf6..b22614bcdc7 100644
--- a/sbin/iked/ca.c
+++ b/sbin/iked/ca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ca.c,v 1.22 2013/03/21 04:30:14 deraadt Exp $ */
+/* $OpenBSD: ca.c,v 1.23 2013/11/14 12:38:20 markus Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -523,7 +523,7 @@ ca_reload(struct iked *env)
X509_FILETYPE_PEM)) {
log_warn("%s: failed to load ca file %s", __func__,
entry->d_name);
- ca_sslerror();
+ ca_sslerror(__func__);
continue;
}
log_debug("%s: loaded ca file %s", __func__, entry->d_name);
@@ -549,7 +549,7 @@ ca_reload(struct iked *env)
X509_FILETYPE_PEM)) {
log_warn("%s: failed to load crl file %s", __func__,
entry->d_name);
- ca_sslerror();
+ ca_sslerror(__func__);
continue;
}
@@ -619,7 +619,7 @@ ca_reload(struct iked *env)
X509_FILETYPE_PEM)) {
log_warn("%s: failed to load cert file %s", __func__,
entry->d_name);
- ca_sslerror();
+ ca_sslerror(__func__);
continue;
}
log_debug("%s: loaded cert file %s", __func__, entry->d_name);
@@ -884,7 +884,7 @@ ca_validate_pubkey(struct iked *env, struct iked_static_id *id,
ret = 0;
sslerr:
if (ret != 0)
- ca_sslerror();
+ ca_sslerror(__func__);
done:
ibuf_release(idp.id_buf);
if (peerkey != NULL)
@@ -1115,11 +1115,11 @@ ca_sslinit(void)
}
void
-ca_sslerror(void)
+ca_sslerror(const char *caller)
{
u_long error;
while ((error = ERR_get_error()) != 0)
- log_warn("%s: %.100s", __func__,
+ log_warn("%s: %s: %.100s", __func__, caller,
ERR_error_string(error, NULL));
}
diff --git a/sbin/iked/crypto.c b/sbin/iked/crypto.c
index 3f96c260972..9bfe6b5fd3b 100644
--- a/sbin/iked/crypto.c
+++ b/sbin/iked/crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.c,v 1.9 2013/01/08 10:38:19 reyk Exp $ */
+/* $OpenBSD: crypto.c,v 1.10 2013/11/14 12:38:20 markus Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -384,7 +384,7 @@ cipher_update(struct iked_cipher *encr, void *in, size_t inlen,
olen = 0;
if (!EVP_CipherUpdate(encr->encr_ctx, out, &olen, in, inlen)) {
- ca_sslerror();
+ ca_sslerror(__func__);
*outlen = 0;
return;
}
@@ -398,7 +398,7 @@ cipher_final(struct iked_cipher *encr, void *out, size_t *outlen)
olen = 0;
if (!EVP_CipherFinal_ex(encr->encr_ctx, out, &olen)) {
- ca_sslerror();
+ ca_sslerror(__func__);
*outlen = 0;
return;
}
@@ -591,7 +591,7 @@ dsa_setkey(struct iked_dsa *dsa, void *key, size_t keylen, u_int8_t type)
return (dsa->dsa_keydata);
sslerr:
- ca_sslerror();
+ ca_sslerror(__func__);
err:
log_debug("%s: error", __func__);
@@ -684,7 +684,7 @@ dsa_verify_final(struct iked_dsa *dsa, void *buf, size_t len)
} else {
if (EVP_VerifyFinal(dsa->dsa_ctx, buf, len,
dsa->dsa_key) != 1) {
- ca_sslerror();
+ ca_sslerror(__func__);
return (-1);
}
}
diff --git a/sbin/iked/iked.h b/sbin/iked/iked.h
index b3a7604d8ce..84b8f70fe97 100644
--- a/sbin/iked/iked.h
+++ b/sbin/iked/iked.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iked.h,v 1.56 2013/01/08 10:38:19 reyk Exp $ */
+/* $OpenBSD: iked.h,v 1.57 2013/11/14 12:38:20 markus Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -779,7 +779,7 @@ int ca_setcert(struct iked *, struct iked_sahdr *, struct iked_id *,
int ca_setauth(struct iked *, struct iked_sa *,
struct ibuf *, enum privsep_procid);
void ca_sslinit(void);
-void ca_sslerror(void);
+void ca_sslerror(const char *);
char *ca_asn1_name(u_int8_t *, size_t);
char *ca_x509_name(void *);