From 848f01e7d3480a3b7889c765c4be1731bac25c26 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Tue, 31 May 2016 13:51:54 +0930 Subject: [PATCH] Only log debug statements if a keyring identity cannot be opened --- keyring.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/keyring.c b/keyring.c index 35870373..f615750d 100644 --- a/keyring.c +++ b/keyring.c @@ -1179,7 +1179,8 @@ static int keyring_identity_mac(const keyring_identity *id, unsigned char *pkrsa unsigned __len = (len); \ if (__len > sizeof work - ofs) { \ bzero(work, ofs); \ - return WHY("Input too long"); \ + DEBUG(keyring, "Input too long"); \ + return -1; \ } \ bcopy((buf), &work[ofs], __len); \ ofs += __len; \ @@ -1195,8 +1196,10 @@ static int keyring_identity_mac(const keyring_identity *id, unsigned char *pkrsa } kp = kp->next; } - if (!found) - return WHY("Identity does not have a primary key"); + if (!found){ + DEBUG(keyring,"Identity does not have a primary key"); + return -1; + } APPEND(id->PKRPin, strlen(id->PKRPin)); #undef APPEND crypto_hash_sha512(mac, work, ofs);