]> the.earth.li Git - onak.git/blobdiff - sigcheck.c
Remove trailing newline on sigcheck debug output
[onak.git] / sigcheck.c
index a0f4feb2d6bada946f8eaf2f73088e64d997f8e6..cbc28b87ccfbeacaade0f5a2c88d2a76c1e5a788 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdint.h>
 
 #include "config.h"
+#include "keyid.h"
 #include "keystructs.h"
 #include "log.h"
 #include "openpgp.h"
@@ -65,6 +66,7 @@ int check_packet_sighash(struct openpgp_publickey *key,
        uint8_t *hashdata[8];
        size_t hashlen[8];
        int chunks, i;
+       uint64_t keyid;
 
        keyheader[0] = 0x99;
        keyheader[1] = key->publickey->length >> 8;
@@ -149,8 +151,10 @@ int check_packet_sighash(struct openpgp_publickey *key,
                sighash = &sig->data[siglen + unhashedlen + 2];
                break;
        default:
-               logthing(LOGTHING_ERROR, "Unknown signature version %d",
-                               sig->data[0]);
+               get_keyid(key, &keyid);
+               logthing(LOGTHING_ERROR,
+                       "Unknown signature version %d on 0x%016" PRIX64,
+                       sig->data[0], keyid);
                return -1;
        }
 
@@ -178,6 +182,7 @@ int check_packet_sighash(struct openpgp_publickey *key,
                }
                ripemd160_digest(&ripemd160_context, RIPEMD160_DIGEST_SIZE,
                        hash);
+               break;
 #else
                logthing(LOGTHING_INFO, "RIPEMD160 support not available.");
                return -1;
@@ -235,13 +240,16 @@ int check_packet_sighash(struct openpgp_publickey *key,
                return -1;
 #endif
        default:
-               logthing(LOGTHING_ERROR, "Unsupported signature hash type %d",
-                               hashtype);
+               get_keyid(key, &keyid);
+               logthing(LOGTHING_ERROR,
+                       "Unsupported signature hash type %d on 0x%016" PRIX64,
+                       hashtype,
+                       keyid);
                return -1;
        }
 
        logthing(LOGTHING_DEBUG, "Hash type: %d, %d chunks, "
-               "calculated: %02X%02X / actual: %02X%02X\n",
+               "calculated: %02X%02X / actual: %02X%02X",
                hashtype, chunks,
                hash[0], hash[1], sighash[0], sighash[1]);