Skip to content

Commit

Permalink
Relax parsing of JER OCTET STRING
Browse files Browse the repository at this point in the history
Since previous commit broke existing applications,
revert parts of it, allowing strings broken into chunks.
  • Loading branch information
mouse07410 committed Aug 6, 2024
1 parent 9ac139f commit 2782c36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions skeletons/OCTET_STRING_jer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2782c36

Please sign in to comment.