]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
fixed serial number conversion from hex
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 5 Oct 2009 21:52:35 +0000 (23:52 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 5 Oct 2009 21:52:35 +0000 (23:52 +0200)
src/openac/openac.c

index 89acc06b9965d4bcc0874fc74a1adda0ce780ede..2b9270ff96afc52158d6ec84e15747cec49c4102 100755 (executable)
@@ -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);
                }