From b798215c6df9120833209080668a02a91656e12f Mon Sep 17 00:00:00 2001 From: Mouse Date: Wed, 7 Aug 2024 22:49:00 -0400 Subject: [PATCH] Allow LF,CF,FF,Space in JER JSON Hex OCTET STRING --- skeletons/OCTET_STRING_jer.c | 8 ++------ tests/tests-skeletons/check-OCTET_STRING.c | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/skeletons/OCTET_STRING_jer.c b/skeletons/OCTET_STRING_jer.c index f6c5ff596..53b682a3d 100644 --- a/skeletons/OCTET_STRING_jer.c +++ b/skeletons/OCTET_STRING_jer.c @@ -252,12 +252,8 @@ 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) { - /* don't allow tab - case 0x09: - */ - case 0x20: /* allow space */ - /* allow LF, FF, CR */ - case 0x0a: case 0x0c: case 0x0d: + /* allow LF, FF, CR, space */ + case 0x0a: case 0x0c: case 0x0d: case 0x20: continue; case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ diff --git a/tests/tests-skeletons/check-OCTET_STRING.c b/tests/tests-skeletons/check-OCTET_STRING.c index 84ee7335d..af5067e44 100644 --- a/tests/tests-skeletons/check-OCTET_STRING.c +++ b/tests/tests-skeletons/check-OCTET_STRING.c @@ -178,7 +178,8 @@ main() { check_jer(HEX, "\"", 0); check_jer(HEX, "", 0); check_jer(HEX, "\"6869\"", "hi"); - check_jer(HEX, "\"68 69\"", 0); + //check_jer(HEX, "\"68 69\"", 0); /* we want to allow space */ + check_jer(HEX, "\"68 69\"", "hi"); check_jer(UTF8, "\"\"", ""); check_jer(UTF8, "\"", 0);