]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
bubble up an error if none of the passhrases work
authorEric Covener <covener@apache.org>
Sun, 1 Mar 2020 22:40:03 +0000 (22:40 +0000)
committerEric Covener <covener@apache.org>
Sun, 1 Mar 2020 22:40:03 +0000 (22:40 +0000)
previously, the un-decodable z->encoded would get set to NULL
but success would be returned

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874674 13f79535-47bb-0310-9956-ffa450edef68

modules/session/mod_session_crypto.c

index be7e7b18070ba0a71a11fd2c9276195c4033f5ea..6e180f8cf349b2f251dc74506bcacf79670c45b6 100644 (file)
@@ -391,6 +391,8 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
         return res;
     }
 
+    res = APR_ECRYPT; /* in case we exhaust all passphrases */
+
     /* try each passphrase in turn */
     for (; i < dconf->passphrases->nelts; i++) {
         const char *passphrase = APR_ARRAY_IDX(dconf->passphrases, i, char *);