summaryrefslogtreecommitdiff
path: root/src/libimcv/pts/pts_file_meas.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-11-21 10:22:31 +0100
committerYves-Alexis Perez <corsac@corsac.net>2017-11-21 10:22:31 +0100
commit6eb3bec5bee061bbb6a5c10f01d9737fb4597265 (patch)
treec1d58904577a286f7788ab5d2a4f116b07163698 /src/libimcv/pts/pts_file_meas.c
parent745cb3e75fbcd8bc70e8b5f55a91ae2c8a274688 (diff)
parente1d78dc2faaa06e7c3f71ef674a71e4de2f0758e (diff)
downloadvyos-strongswan-6eb3bec5bee061bbb6a5c10f01d9737fb4597265.tar.gz
vyos-strongswan-6eb3bec5bee061bbb6a5c10f01d9737fb4597265.zip
Update upstream source from tag 'upstream/5.6.1'
Update to upstream version '5.6.1' with Debian dir 3996fc7d7b19a96b252a7fcbac12c94452d1e7d7
Diffstat (limited to 'src/libimcv/pts/pts_file_meas.c')
-rw-r--r--src/libimcv/pts/pts_file_meas.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libimcv/pts/pts_file_meas.c b/src/libimcv/pts/pts_file_meas.c
index 92f513a2d..2f8935a87 100644
--- a/src/libimcv/pts/pts_file_meas.c
+++ b/src/libimcv/pts/pts_file_meas.c
@@ -140,7 +140,7 @@ METHOD(pts_file_meas_t, check, bool,
{
while (e->enumerate(e, &hash))
{
- if (chunk_equals_const(entry->measurement, hash))
+ if (chunk_equals(entry->measurement, hash))
{
status = SUCCESS;
break;
@@ -193,12 +193,13 @@ METHOD(pts_file_meas_t, verify, bool,
{
int fid, fid_last = 0;
char *filename;
- chunk_t measurement;
+ uint8_t measurement_buf[HASH_SIZE_SHA512], *hex_meas_buf;
+ chunk_t measurement, hex_meas;
entry_t *entry;
enumerator_t *enumerator = NULL;
bool found = FALSE, match = FALSE, success = TRUE;
- while (e_hash->enumerate(e_hash, &fid, &filename, &measurement))
+ while (e_hash->enumerate(e_hash, &fid, &filename, &hex_meas_buf))
{
if (fid != fid_last)
{
@@ -241,7 +242,10 @@ METHOD(pts_file_meas_t, verify, bool,
if (found && !match)
{
- if (chunk_equals_const(measurement, entry->measurement))
+ hex_meas = chunk_from_str(hex_meas_buf);
+ measurement = chunk_from_hex(hex_meas, measurement_buf);
+
+ if (chunk_equals(measurement, entry->measurement))
{
match = TRUE;
DBG2(DBG_PTS, " %#B for '%s' is ok",