]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
fixes in loop for SRK password input
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 8 Sep 2014 08:31:40 +0000 (10:31 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 8 Sep 2014 08:31:40 +0000 (10:31 +0200)
lib/tpm.c

index 7ddfdfb29530d30bfae5e39676a9db41a4b358bd..e962386b0c21ad220fb0dc5c795290274a36238b 100644 (file)
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -1020,7 +1020,7 @@ import_tpm_pubkey_cb(gnutls_pubkey_t pkey,
 {
        unsigned int attempts = 0;
        char pin1[GNUTLS_PKCS11_MAX_PIN_LEN];
-       int ret;
+       int ret, sret;
 
        do {
                ret =
@@ -1031,10 +1031,10 @@ import_tpm_pubkey_cb(gnutls_pubkey_t pkey,
                        break;
 
                if (ret == GNUTLS_E_TPM_SRK_PASSWORD_ERROR) {
-                       ret =
+                       sret =
                            tpm_pin(&pkey->pin, &srk_uuid, storage, pin1,
                                    sizeof(pin1), attempts++);
-                       if (ret < 0) {
+                       if (sret < 0) {
                                gnutls_assert();
                                return GNUTLS_E_TPM_SRK_PASSWORD_ERROR;
                        }