diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-07-21 08:36:32 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-07-21 11:47:41 +0200 |
commit | 1e424c305cbbab4970df9b903a4e8e409fb969e4 (patch) | |
tree | 92d8917d228e91ed7ced26dbbc119c9a530f28d3 | |
parent | 84b1f2b39f02c5ba241f50807329b53fdac1a903 (diff) | |
download | gnutls-1e424c305cbbab4970df9b903a4e8e409fb969e4.tar.gz |
tpm: use gnutls_hex_decode for uuid decoding
-rw-r--r-- | lib/tpm.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -893,6 +893,7 @@ static int decode_tpmkey_url(const char *url, struct tpmkey_url_st *s) } else if ((p = strstr(url, "uuid=")) != NULL) { char tmp_uuid[33]; uint8_t raw_uuid[16]; + gnutls_datum_t tmp; p += sizeof("uuid=") - 1; size = strlen(p); @@ -906,10 +907,12 @@ static int decode_tpmkey_url(const char *url, struct tpmkey_url_st *s) } tmp_uuid[j] = 0; + tmp.data = tmp_uuid; + tmp.size = strlen(tmp_uuid); size = sizeof(raw_uuid); ret = - _gnutls_hex2bin(tmp_uuid, strlen(tmp_uuid), raw_uuid, - &size); + gnutls_hex_decode(&tmp, raw_uuid, + &size); if (ret < 0) { gnutls_assert(); goto cleanup; |