aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2009-10-05 23:52:35 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2009-10-05 23:52:35 +0200
commitafdaa9e5bf465848ba24f983f01f0320cecaac8b (patch)
tree67c412a4463412ec8fb40d6b96f328b686a0de30 /src
parent0da0f3fc3f77fdcbbff0f5e76900a0a19b326b9c (diff)
downloadstrongswan-afdaa9e5bf465848ba24f983f01f0320cecaac8b.tar.bz2
strongswan-afdaa9e5bf465848ba24f983f01f0320cecaac8b.tar.xz
fixed serial number conversion from hex
Diffstat (limited to 'src')
-rwxr-xr-xsrc/openac/openac.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/openac/openac.c b/src/openac/openac.c
index 89acc06b9..2b9270ff9 100755
--- a/src/openac/openac.c
+++ b/src/openac/openac.c
@@ -93,6 +93,11 @@ static chunk_t read_serial(void)
hex.len = fread(hex.ptr, 1, hex.len, fd);
if (hex.len)
{
+ /* remove any terminating newline character */
+ if (hex.ptr[hex.len-1] == '\n')
+ {
+ hex.len--;
+ }
serial = chunk_alloca((hex.len / 2) + (hex.len % 2));
serial = chunk_from_hex(hex, serial.ptr);
}