summaryrefslogtreecommitdiff
path: root/lib/tpm.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-02-16 10:17:58 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-02-16 10:31:53 +0100
commitccdff2dc101e88dfa8662fe2f5bb84c4034d21c8 (patch)
tree519c5b5c8e7650edcaa487b2fe64542290aadd80 /lib/tpm.c
parent1216eabdcb81b9d13fb3c422b411a8c1cd700ee7 (diff)
downloadgnutls-ccdff2dc101e88dfa8662fe2f5bb84c4034d21c8.tar.gz
cleaned up the PIN calling in TPM
Diffstat (limited to 'lib/tpm.c')
-rw-r--r--lib/tpm.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/tpm.c b/lib/tpm.c
index 7a06963e49..815457a433 100644
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -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 */