diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-10-19 16:20:02 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-10-19 16:20:02 +0300 |
commit | c137e36e6284efea708442bd67c01b5dc4130264 (patch) | |
tree | 9ab3fc4391953e8a378405e2b48eadf88be47709 /rpmio | |
parent | 0660fe94422b1a548e08f5e1f70b4a42fe8e4f7c (diff) | |
download | librpm-tizen-c137e36e6284efea708442bd67c01b5dc4130264.tar.gz librpm-tizen-c137e36e6284efea708442bd67c01b5dc4130264.tar.bz2 librpm-tizen-c137e36e6284efea708442bd67c01b5dc4130264.zip |
Eliminate copy-paste nibble(), use rnibble() instead
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/digest_beecrypt.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/rpmio/digest_beecrypt.c b/rpmio/digest_beecrypt.c index 1ffa45037..7ff706034 100644 --- a/rpmio/digest_beecrypt.c +++ b/rpmio/digest_beecrypt.c @@ -306,17 +306,6 @@ static int pgpSetKeyMpiRSA(pgpDigAlg pgpkey, int num, return rc; } -static inline unsigned char nibble(char c) -{ - if (c >= '0' && c <= '9') - return (c - '0'); - if (c >= 'A' && c <= 'F') - return (c - 'A') + 10; - if (c >= 'a' && c <= 'f') - return (c - 'a') + 10; - return 0; -} - static int pgpVerifySigRSA(pgpDigAlg pgpkey, pgpDigAlg pgpsig, uint8_t *hash, size_t hashlen, int hash_algo) { struct pgpDigKeyRSA_s *key = pgpkey->data; @@ -367,7 +356,7 @@ static int pgpVerifySigRSA(pgpDigAlg pgpkey, pgpDigAlg pgpsig, uint8_t *hash, si return 1; *bp++ = 0; for (; *prefix; prefix += 2) - *bp++ = (nibble(prefix[0]) << 4) | nibble(prefix[1]); + *bp++ = (rnibble(prefix[0]) << 4) | rnibble(prefix[1]); memcpy(bp, hash, hashlen); mpnzero(&rsahm); (void) mpnsetbin(&rsahm, buf, nb); |