diff options
author | Yves-Alexis Perez <corsac@corsac.net> | 2017-04-01 16:26:44 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@corsac.net> | 2017-04-01 16:26:44 +0200 |
commit | dc9380af81fbce8e1a9532b07bc671b9d346101b (patch) | |
tree | 219f7df0b01243ac1c41c7f679d1b4c6aef36b27 /src/libstrongswan/utils/chunk.c | |
parent | 212c0ba74c0e453497b840f9cd131ec99f73754a (diff) | |
parent | 05ddd767992d68bb38c7f16ece142e8c2e9ae016 (diff) | |
download | vyos-strongswan-dc9380af81fbce8e1a9532b07bc671b9d346101b.tar.gz vyos-strongswan-dc9380af81fbce8e1a9532b07bc671b9d346101b.zip |
Merge tag 'upstream/5.5.2'
Upstream version 5.5.2
Diffstat (limited to 'src/libstrongswan/utils/chunk.c')
-rw-r--r-- | src/libstrongswan/utils/chunk.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstrongswan/utils/chunk.c b/src/libstrongswan/utils/chunk.c index 2f824a259..0c50ab788 100644 --- a/src/libstrongswan/utils/chunk.c +++ b/src/libstrongswan/utils/chunk.c @@ -504,7 +504,13 @@ chunk_t chunk_from_hex(chunk_t hex, char *buf) u_char *ptr; bool odd = FALSE; - /* subtract the number of optional ':' separation characters */ + /* skip an optional 0x prefix */ + if (hex.len > 1 && hex.ptr[1] == 'x' && hex.ptr[0] == '0') + { + hex = chunk_skip(hex, 2); + } + + /* subtract the number of optional ':' separation characters */ len = hex.len; ptr = hex.ptr; for (i = 0; i < hex.len; i++) |