diff options
author | Rich Salz <rsalz@openssl.org> | 2016-05-12 15:52:58 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-05-16 15:21:10 -0400 |
commit | 49445f21da5ad436a117d0d4cc6220c4bbbbf8a7 (patch) | |
tree | b8013a1a1dc02e3b721e137a5bd8847c5a2766d3 /crypto/pem | |
parent | 589902b2cbc667564642a0fdedfb2ef176dba0e8 (diff) | |
download | openssl-49445f21da5ad436a117d0d4cc6220c4bbbbf8a7.tar.gz |
Use OPENSSL_hexchar2int
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/pem')
-rw-r--r-- | crypto/pem/pem_lib.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 4ca61875ee..fce8a3adf2 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -558,13 +558,8 @@ static int load_iv(char **fromp, unsigned char *to, int num) to[i] = 0; num *= 2; for (i = 0; i < num; i++) { - if ((*from >= '0') && (*from <= '9')) - v = *from - '0'; - else if ((*from >= 'A') && (*from <= 'F')) - v = *from - 'A' + 10; - else if ((*from >= 'a') && (*from <= 'f')) - v = *from - 'a' + 10; - else { + v = OPENSSL_hexchar2int(*from); + if (v < 0) { PEMerr(PEM_F_LOAD_IV, PEM_R_BAD_IV_CHARS); return (0); } |