Skip to content

Commit

Permalink
Merge pull request bwesterb#2 from pohlm01/main
Browse files Browse the repository at this point in the history
Fix prefix length for DNSName
  • Loading branch information
bwesterb authored Sep 6, 2024
2 parents 4a29d87 + af94555 commit 68f2404
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
www/
4 changes: 2 additions & 2 deletions mtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ func (c *Claims) UnmarshalBinary(data []byte) error {

for !packed.Empty() {
var domain []byte
if !packed.ReadUint16LengthPrefixed((*cryptobyte.String)(&domain)) {
if !packed.ReadUint8LengthPrefixed((*cryptobyte.String)(&domain)) {
return ErrTruncated
}

Expand Down Expand Up @@ -1439,7 +1439,7 @@ func (c *Claims) MarshalBinary() ([]byte, error) {
b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { // claim_info
b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) { // dns_names
for _, domain := range sorted {
b.AddUint16LengthPrefixed(func(b *cryptobyte.Builder) {
b.AddUint8LengthPrefixed(func(b *cryptobyte.Builder) {
b.AddBytes([]byte(domain))
})
}
Expand Down

0 comments on commit 68f2404

Please sign in to comment.