There was an error while loading. Please reload this page.
1 parent 7f4bf9f commit cc6cdceCopy full SHA for cc6cdce
1 file changed
Modules/_hashopenssl.c
@@ -504,10 +504,6 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass, int passlen,
504
HMAC_CTX_init(&hctx);
505
p = out;
506
tkeylen = keylen;
507
- if (!pass)
508
- passlen = 0;
509
- else if(passlen == -1)
510
- passlen = strlen(pass);
511
if (!HMAC_Init_ex(&hctx_tpl, pass, passlen, digest, NULL)) {
512
HMAC_CTX_cleanup(&hctx_tpl);
513
return 0;
@@ -671,7 +667,7 @@ pbkdf2_hmac(PyObject *self, PyObject *args, PyObject *kwdict)
671
667
672
668
Py_BEGIN_ALLOW_THREADS
673
669
retval = PKCS5_PBKDF2_HMAC_fast((char*)password.buf, (int)password.len,
674
- (unsigned char *)salt.buf, salt.len,
670
+ (unsigned char *)salt.buf, (int)salt.len,
675
iterations, digest, dklen,
676
(unsigned char *)key);
677
Py_END_ALLOW_THREADS
0 commit comments