(_hx509_pbe_decrypt): also try the empty password
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16841 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1462,10 +1462,16 @@ _hx509_pbe_decrypt(hx509_context context,
|
|||||||
pw = _hx509_lock_get_passwords(lock);
|
pw = _hx509_lock_get_passwords(lock);
|
||||||
|
|
||||||
ret = HX509_CRYPTO_INTERNAL_ERROR;
|
ret = HX509_CRYPTO_INTERNAL_ERROR;
|
||||||
for (i = 0; i < pw->len; i++) {
|
for (i = 0; i < pw->len + 1; i++) {
|
||||||
hx509_crypto crypto;
|
hx509_crypto crypto;
|
||||||
|
const char *password;
|
||||||
|
|
||||||
ret = (*s2k)(context, pw->val[i], ai->parameters, &crypto,
|
if (i < pw->len)
|
||||||
|
password = pw->val[i];
|
||||||
|
else
|
||||||
|
password = "";
|
||||||
|
|
||||||
|
ret = (*s2k)(context, password, ai->parameters, &crypto,
|
||||||
&key, &iv, enc_oid, md);
|
&key, &iv, enc_oid, md);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
goto out;
|
goto out;
|
||||||
|
Reference in New Issue
Block a user