[pkg-opensc-commit] [libp11] 08/12: Prevent printing superfluous error messages
Eric Dorland
eric at moszumanska.debian.org
Sat Jan 28 08:45:04 UTC 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libp11.
commit 8ac8657710370e3e838d2ef2ff09ef0e787b6c0f
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date: Wed Jan 18 19:53:51 2017 +0100
Prevent printing superfluous error messages
---
src/eng_back.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/eng_back.c b/src/eng_back.c
index a88b90c..c07d3da 100644
--- a/src/eng_back.c
+++ b/src/eng_back.c
@@ -529,7 +529,8 @@ static X509 *ctx_load_cert(ENGINE_CTX *ctx, const char *s_slot_cert_id,
if (selected_cert != NULL) {
x509 = X509_dup(selected_cert->x509);
} else {
- fprintf(stderr, "Certificate not found.\n");
+ if (login) /* Only print the error on the second attempt */
+ fprintf(stderr, "Certificate not found.\n");
x509 = NULL;
}
if (cert_label != NULL)
@@ -807,7 +808,8 @@ static EVP_PKEY *ctx_load_key(ENGINE_CTX *ctx, const char *s_slot_key_id,
PKCS11_get_private_key(selected_key) :
PKCS11_get_public_key(selected_key);
} else {
- fprintf(stderr, "Key not found.\n");
+ if (login) /* Only print the error on the second attempt */
+ fprintf(stderr, "Key not found.\n");
pk = NULL;
}
if (key_label != NULL)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git
More information about the pkg-opensc-commit
mailing list