examples/fips_validation: ignore \r in input files
authorOlivier Matz <olivier.matz@6wind.com>
Mon, 13 Jul 2020 11:51:14 +0000 (13:51 +0200)
committerOlivier Matz <olivier.matz@6wind.com>
Fri, 31 Jul 2020 09:52:28 +0000 (11:52 +0200)
Some test vectors contain '\r' before '\n' (see link). Ignore them.

Link: https://www.openssl.org/docs/fips/testvectors-linux-2007-10-10.tar.gz
Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
examples/fips_validation/fips_validation.c

index 13f763c..858f581 100644 (file)
@@ -33,6 +33,8 @@ get_file_line(void)
 
                if (loc >= MAX_LINE_CHAR - 1)
                        return -ENOMEM;
+               if (c == '\r')
+                       continue;
                if (c == '\n')
                        break;
                line[loc++] = c;