]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
OpenSSL: Fix recognition of repeated 'wrong passphrase' errors
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 15 Jun 2012 13:26:26 +0000 (14:26 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 15 Jun 2012 13:29:03 +0000 (14:29 +0100)
Without it, we were getting the wrong error if the passphrase was wrong
a second time, and not correctly staying in the retry loop:

Enter PEM pass phrase:
140379913099200:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:536:
Loading private key failed (wrong passphrase?)
Enter PEM pass phrase:
140379913099200:error:23077074:PKCS12 routines:PKCS12_pbe_crypt:pkcs12 cipherfinal error:p12_decr.c:97:
Loading private key failed (see above errors)

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
openssl.c
www/changelog.xml

index efd342c04ef816faa604d3756dd14e6b9b363c6d..a03b20e6dfd374a1652a56afcb50754e2c9c88a7 100644 (file)
--- a/openssl.c
+++ b/openssl.c
@@ -647,6 +647,7 @@ static int is_pem_password_error(struct openconnect_info *vpninfo)
            ERR_GET_REASON(err) == EVP_R_BAD_DECRYPT) {
                vpn_progress(vpninfo, PRG_ERR,
                             _("Loading private key failed (wrong passphrase?)\n"));
+               ERR_clear_error();
                return 1;
        }
 
index 0a0d1e274cc2a9b88b7794c88ddb3e8aee8d61d8..e1e7550e6f872471814653b6af50a808a2be25bd 100644 (file)
@@ -17,6 +17,7 @@
 <ul>
    <li><b>OpenConnect HEAD</b>
      <ul>
+       <li>Fix repeated passphrase retry for OpenSSL.</li>
        <li>Add keystore support for Android.</li>
        <li>Support TPM, and also additional checks on PKCS#11 certs, even with GnuTLS 2.12.</li>
        <li>Fix library references to OpenSSL's <tt>ERR_print_errors_cb()</tt> when built against GnuTLS v2.12.</li>