summaryrefslogtreecommitdiff
path: root/Modules/_hashopenssl.c
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-04-13 21:27:19 -0400
committerR David Murray <rdmurray@bitdance.com>2012-04-13 21:27:19 -0400
commitea7bc055b08fb442986e0735b1b5b325b0b51ecc (patch)
tree20c2b837c787daf7e95ece075e6544627b17625a /Modules/_hashopenssl.c
parentc32365d2ce552d1d17279e30a564509235ffb1db (diff)
parentc2c9c905706160bf34aea12f2348210aac3e0da2 (diff)
downloadcpython-ea7bc055b08fb442986e0735b1b5b325b0b51ecc.tar.gz
Merge #14399: corrected news item
Diffstat (limited to 'Modules/_hashopenssl.c')
-rw-r--r--Modules/_hashopenssl.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index dd4317fca0..d37689e0e6 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -201,13 +201,11 @@ EVP_hexdigest(EVPobject *self, PyObject *unused)
/* Make hex version of the digest */
for(i=j=0; i<digest_size; i++) {
- char c;
+ unsigned char c;
c = (digest[i] >> 4) & 0xf;
- c = (c>9) ? c+'a'-10 : c + '0';
- hex_digest[j++] = c;
+ hex_digest[j++] = Py_hexdigits[c];
c = (digest[i] & 0xf);
- c = (c>9) ? c+'a'-10 : c + '0';
- hex_digest[j++] = c;
+ hex_digest[j++] = Py_hexdigits[c];
}
retval = PyUnicode_FromStringAndSize(hex_digest, digest_size * 2);
PyMem_Free(hex_digest);