projects
/
tools
/
librpm-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60bb36b
)
Remove redundant strlen()'s on sha1 digest verification
author
Panu Matilainen
<pmatilai@redhat.com>
Thu, 28 Apr 2011 07:31:23 +0000
(10:31 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Thu, 28 Apr 2011 12:24:09 +0000
(15:24 +0300)
- string comparison notices different length anyway, avoid going
through the same data twice
lib/signature.c
patch
|
blob
|
history
diff --git
a/lib/signature.c
b/lib/signature.c
index
ca12be8
..
e0b4893
100644
(file)
--- a/
lib/signature.c
+++ b/
lib/signature.c
@@
-445,7
+445,7
@@
verifySHA1Digest(rpmtd sigtd, DIGEST_CTX sha1ctx, char **msg)
(void) rpmDigestFinal(ctx, (void **)&SHA1, NULL, 1);
- if (SHA1 == NULL ||
strlen(SHA1) != strlen(sig) ||
!rstreq(SHA1, sig)) {
+ if (SHA1 == NULL || !rstreq(SHA1, sig)) {
rasprintf(msg, "%s %s Expected(%s) != (%s)\n", title,
rpmSigString(res), sig, SHA1 ? SHA1 : "(nil)");
} else {