diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-16 10:17:58 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-16 10:31:53 +0100 |
commit | ccdff2dc101e88dfa8662fe2f5bb84c4034d21c8 (patch) | |
tree | 519c5b5c8e7650edcaa487b2fe64542290aadd80 /lib/tpm.c | |
parent | 1216eabdcb81b9d13fb3c422b411a8c1cd700ee7 (diff) | |
download | gnutls-ccdff2dc101e88dfa8662fe2f5bb84c4034d21c8.tar.gz |
cleaned up the PIN calling in TPM
Diffstat (limited to 'lib/tpm.c')
-rw-r--r-- | lib/tpm.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -194,23 +194,29 @@ int ret; if (uuid) { if (memcmp(uuid, &srk_uuid, sizeof(TSS_UUID)) == 0) - label = "SRK"; + { + label = "SRK"; + + ret = encode_tpmkey_url(&url, uuid, storage); + if (ret < 0) + return gnutls_assert_val(ret); + } else { + label = "TPM"; + ret = encode_tpmkey_url(&url, uuid, storage); if (ret < 0) return gnutls_assert_val(ret); - - label = url; } } else label = "unknown"; if (pin_info && pin_info->cb) - ret = pin_info->cb(pin_info->data, attempts, "TPM", label, flags, pin, pin_size); + ret = pin_info->cb(pin_info->data, attempts, url, label, flags, pin, pin_size); else if (_gnutls_pin_func) - ret = _gnutls_pin_func(_gnutls_pin_data, attempts, "TPM", label, flags, pin, pin_size); + ret = _gnutls_pin_func(_gnutls_pin_data, attempts, url, label, flags, pin, pin_size); else ret = gnutls_assert_val(GNUTLS_E_TPM_KEY_PASSWORD_ERROR); /* doesn't really matter */ |