From 2782c366dfe542e16e81aaa463691dbbb250842d Mon Sep 17 00:00:00 2001 From: Mouse <5923577+mouse07410@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:12:44 -0400 Subject: [PATCH] Relax parsing of JER OCTET STRING Since previous commit broke existing applications, revert parts of it, allowing strings broken into chunks. --- skeletons/OCTET_STRING_jer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/skeletons/OCTET_STRING_jer.c b/skeletons/OCTET_STRING_jer.c index 64f906042..f9f4ef48b 100644 --- a/skeletons/OCTET_STRING_jer.c +++ b/skeletons/OCTET_STRING_jer.c @@ -252,6 +252,12 @@ static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_b for(; p < pend; p++) { int ch = *(const unsigned char *)p; switch(ch) { + /* do not allow tab, space + case 0x09: case 0x20: + */ + /* allow LF, FF, CR */ + case 0x0a: case 0x0c: case 0x0d: + continue; case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ clv = (clv << 4) + (ch - 0x30);