]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove unused code path from PBKDF2 that is causing a warning on Win64
authorChristian Heimes <christian@cheimes.de>
Mon, 18 Nov 2013 08:59:44 +0000 (09:59 +0100)
committerChristian Heimes <christian@cheimes.de>
Mon, 18 Nov 2013 08:59:44 +0000 (09:59 +0100)
Modules/_hashopenssl.c

index b4c5b511ee649613c4222063fcc0a554a005e287..a866fbf7f95dfd88c702f98ad41b5dfeed20817b 100644 (file)
@@ -504,10 +504,6 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass, int passlen,
     HMAC_CTX_init(&hctx);
     p = out;
     tkeylen = keylen;
-    if (!pass)
-        passlen = 0;
-    else if(passlen == -1)
-        passlen = strlen(pass);
     if (!HMAC_Init_ex(&hctx_tpl, pass, passlen, digest, NULL)) {
         HMAC_CTX_cleanup(&hctx_tpl);
         return 0;
@@ -671,7 +667,7 @@ pbkdf2_hmac(PyObject *self, PyObject *args, PyObject *kwdict)
 
     Py_BEGIN_ALLOW_THREADS
     retval = PKCS5_PBKDF2_HMAC_fast((char*)password.buf, (int)password.len,
-                                    (unsigned char *)salt.buf, salt.len,
+                                    (unsigned char *)salt.buf, (int)salt.len,
                                     iterations, digest, dklen,
                                     (unsigned char *)key);
     Py_END_ALLOW_THREADS