diff options
author | Daiki Ueno <dueno@redhat.com> | 2017-01-06 10:42:07 +0100 |
---|---|---|
committer | Daiki Ueno <dueno@redhat.com> | 2017-01-06 10:42:07 +0100 |
commit | c15d2bfd848a6f1ce2efb86810df2581453e5e0e (patch) | |
tree | c57ef77ddb5525b03b702a937be209fd1ad41164 /cmd/lib/secutil.c | |
parent | d0c2b8f0fbf5712ffd42053ad1f267b0231b2814 (diff) | |
download | nss-hg-c15d2bfd848a6f1ce2efb86810df2581453e5e0e.tar.gz |
Bug 1300109 - Move SECU_HexString2SECItem to basicutil.c, r=franziskus
Also add the stub declaration in basicutil.h, and remove unnecesary
#include for secutil.h in some files.
Diffstat (limited to 'cmd/lib/secutil.c')
-rw-r--r-- | cmd/lib/secutil.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/cmd/lib/secutil.c b/cmd/lib/secutil.c index 9f48f34d4..c5ed068a7 100644 --- a/cmd/lib/secutil.c +++ b/cmd/lib/secutil.c @@ -3833,49 +3833,6 @@ SECU_ParseSSLVersionRangeString(const char *input, return SECSuccess; } -SECItem * -SECU_HexString2SECItem(PLArenaPool *arena, SECItem *item, const char *str) -{ - int i = 0; - int byteval = 0; - int tmp = PORT_Strlen(str); - - PORT_Assert(arena); - PORT_Assert(item); - - if ((tmp % 2) != 0) { - PORT_SetError(SEC_ERROR_INVALID_ARGS); - return NULL; - } - - item = SECITEM_AllocItem(arena, item, tmp / 2); - if (item == NULL) { - return NULL; - } - - while (str[i]) { - if ((str[i] >= '0') && (str[i] <= '9')) { - tmp = str[i] - '0'; - } else if ((str[i] >= 'a') && (str[i] <= 'f')) { - tmp = str[i] - 'a' + 10; - } else if ((str[i] >= 'A') && (str[i] <= 'F')) { - tmp = str[i] - 'A' + 10; - } else { - /* item is in arena and gets freed by the caller */ - return NULL; - } - - byteval = byteval * 16 + tmp; - if ((i % 2) != 0) { - item->data[i / 2] = byteval; - byteval = 0; - } - i++; - } - - return item; -} - SSLNamedGroup groupNameToNamedGroup(char *name) { |