• Eric Orth's avatar
    Improve DNS name parsing · 34fdcd5d
    Eric Orth authored
    *Allow optionally enforcing that the name ends with a zero-length label
     (the root label).
    *Add additional validation that the name doesn't use DNS name
     compression, and that the name is within the max DNS name length.
    *Add an overload that takes a BigEndianReader as input. Better supports
     parsing within a DNS message when the name needs to be parsed to know
     its total length and where the next data starts after the name.
    
    These improvements should be useful in parsing HTTPS records.
    
    Bug: 1138620
    Change-Id: Ice66aa880a8c5407af3bfd9a14d720d518ae2136
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2493153
    Commit-Queue: Eric Orth <ericorth@chromium.org>
    Reviewed-by: default avatarDan McArdle <dmcardle@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#821794}
    34fdcd5d
dns_util.cc 11.9 KB