Blob Blame History Raw
From 42586b51e34519f18fadef2ad3c9c9d77fde0409 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Mon, 5 Mar 2018 15:54:10 -0400
Subject: [PATCH] Fix conversions of bit lengths to byte lengths

Fix a number of places where we weren't correctly converting from length
in bits to length in bytes, and one in the self-tests where the newest
version of NSS complains if the size of a signature was too large
because it was not converted at all.

Based on upstream change dd537bcc644dea163b4c8f3de08d73a60876449d
---
 tests/tools/checksig.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/tools/checksig.c b/tests/tools/checksig.c
index e690911..ab8bb11 100644
--- a/tests/tools/checksig.c
+++ b/tests/tools/checksig.c
@@ -18,6 +18,7 @@
 #include "../../src/config.h"
 
 #include <sys/types.h>
+#include <sys/param.h>
 #include <sys/select.h>
 #include <errno.h>
 #include <limits.h>
@@ -101,6 +102,7 @@ main(int argc, char **argv)
 		printf("error finding public key\n");
 		return 1;
 	}
+	signed_data.signature.len = howmany(signed_data.signature.len, 8);
 	if (VFY_VerifyDataWithAlgorithmID(signed_data.data.data,
 					  signed_data.data.len,
 					  pubkey,
-- 
1.8.3.1