- the one in signature.c wasn't even used...
return ec;
}
-/**
- * Convert hex to binary nibble.
- * @param c hex character
- * @return binary nibble
- */
-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;
-}
-
/* LCL: segfault (realpath annotation?) */
int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
{
MD5[0] = '\0';
for (i = 0, t = MD5, s = arg; i < 16; i++, t++, s += 2)
- *t = (nibble(s[0]) << 4) | nibble(s[1]);
+ *t = (rnibble(s[0]) << 4) | rnibble(s[1]);
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SIGMD5, MD5, sizeof(MD5));
if (qva->qva_mi == NULL) {
MD5[0] = '\0';
for (i = 0, t = MD5, s = arg; i < 16; i++, t++, s += 2)
- *t = (nibble(s[0]) << 4) | nibble(s[1]);
+ *t = (rnibble(s[0]) << 4) | rnibble(s[1]);
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEMD5S, MD5, sizeof(MD5));
if (qva->qva_mi == NULL) {
return NULL;
}
-/**
- * Convert hex to binary nibble.
- * @param c hex character
- * @return binary nibble
- */
-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;
-}
-
#define _fdupe(_fi, _data) \
if ((_fi)->_data != NULL) \
(_fi)->_data = memcpy(xmalloc((_fi)->fc * sizeof(*(_fi)->_data)), \
continue;
}
for (j = 0; j < 16; j++, t++, fmd5 += 2)
- *t = (nibble(fmd5[0]) << 4) | nibble(fmd5[1]);
+ *t = (rnibble(fmd5[0]) << 4) | rnibble(fmd5[1]);
}
fi->fmd5s = hfd(fi->fmd5s, RPM_FORCEFREE_TYPE);
}
}
/**
- * Convert hex to binary nibble.
- * @param c hex character
- * @return binary nibble
- */
-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;
-}
-
-/**
* Verify RSA signature.
* @param ts transaction set
* @retval msg rbose success/failure text
return *sp;
}
-/**
- * Convert hex to binary nibble.
- * @param c hex character
- * @return binary nibble
- */
-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;
-}
-
#ifdef DYING
/**
* Check key for printable characters.
s = rpmvals[i];
t = bin;
for (j = 0; j < 16; j++, t++, s += 2)
- *t = (nibble(s[0]) << 4) | nibble(s[1]);
+ *t = (rnibble(s[0]) << 4) | rnibble(s[1]);
key->data = bin;
key->size = 16;
break;
s = rpmvals[i];
t = bin;
for (j = 0; j < 16; j++, t++, s += 2)
- *t = (nibble(s[0]) << 4) | nibble(s[1]);
+ *t = (rnibble(s[0]) << 4) | rnibble(s[1]);
key->data = bin;
key->size = 16;
break;
return ((rislower(c)) ? (c & ~('a' - 'A')) : c);
}
+/**
+ * Convert hex to binary nibble.
+ * @param c hex character
+ * @return binary nibble
+ */
+static inline unsigned char rnibble(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;
+}
+
/** \ingroup rpmstring
* Locale insensitive strcasecmp(3).
*/