void *key;
struct udevice *dev;
- rc = get_tpm(&dev);
- if (rc)
- return rc;
+ err = get_tpm(&dev);
+ if (err)
+ return err;
if (argc < 5)
return CMD_RET_USAGE;
return CMD_RET_FAILURE;
parse_byte_string(argv[4], usage_auth, NULL);
- err = tpm_find_key_sha1(usage_auth, parent_hash, &parent_handle);
+ err = tpm1_find_key_sha1(dev, usage_auth, parent_hash, &parent_handle);
if (err) {
printf("Could not find matching parent key (err = %d)\n", err);
return CMD_RET_FAILURE;
printf("Found parent key %08x\n", parent_handle);
- err = tpm_load_key2_oiap(parent_handle, key, key_len, usage_auth,
+ err = tpm1_load_key2_oiap(dev, parent_handle, key, key_len, usage_auth,
&key_handle);
if (!err) {
printf("Key handle is 0x%x\n", key_handle);
unsigned int i;
/* fetch list of already loaded keys in the TPM */
- err = tpm_get_capability(dev, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
+ err = tpm1_get_capability(dev, TPM_CAP_HANDLE, TPM_RT_KEY, buf,
sizeof(buf));
if (err)
return -1;
/* now search a(/ the) key which we can access with the given auth */
for (i = 0; i < key_count; ++i) {
buf_len = sizeof(buf);
- err = tpm_get_pub_key_oiap(key_handles[i], auth, buf, &buf_len);
+ err = tpm1_get_pub_key_oiap(dev, key_handles[i], auth, buf, &buf_len);
if (err && err != TPM_AUTHFAIL)
return -1;
if (err)