From: Nikos Mavrogiannopoulos Date: Mon, 8 Sep 2014 08:31:40 +0000 (+0200) Subject: fixes in loop for SRK password input X-Git-Tag: gnutls_3_4_0~972 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fe033e2c7e9d7320c5cedbe85a57bd0ef17e2cdc;p=thirdparty%2Fgnutls.git fixes in loop for SRK password input --- diff --git a/lib/tpm.c b/lib/tpm.c index 7ddfdfb295..e962386b0c 100644 --- 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; }