#32845 closed task (fixed)

Add UTF-8 validation unit tests

Reported by: teor Owned by: teor
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 043-should, utf-8, Unicode
Cc: Actual Points: 0.1
Parent ID: Points: 0.2
Reviewer: nickm Sponsor:


We should add unit tests for the following UTF-8 sequences. Their validity varies between different programming languages. We should go with the common case (if it matches the standard).

surrogate nullsurrog threehigh
EDA081 3000EDA081 EDBFBF

fourhigh fivebyte sixbyte sixhigh
F490BFBF FB80808080 FD80808080 FDBFBFBFBF

fourbyte fourbyte2

Valid in the Unicode standard, invalid in torrcs and directory documents:

See proposal 285 for details, and for the null byte exception:

Test Case Source:
POC||GTFO 19, page 43

Child Tickets

Change History (4)

comment:1 Changed 10 months ago by teor

Actual Points: 0.1

Please review and merge my PR:

I also added some additional error-checking for the string pointer and length.

comment:2 Changed 10 months ago by teor

Status: assignedneeds_review

comment:3 Changed 10 months ago by nickm

Reviewer: nickm

LGTM; squashed and merged.

comment:4 Changed 10 months ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Whoops; should have closed when I merged.

Note: See TracTickets for help on using tickets.