Skip to content

Commit

Permalink
fix: resolve comment
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Aug 3, 2023
1 parent f916316 commit f4dc95f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/encoding/asn1/asn1.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (

// Common errors
var (
ErrBytesAtTheEnd = asn1.StructuralError{Msg: "invalid bytes at the end of the BER data"}
ErrEarlyEOF = asn1.SyntaxError{Msg: "early EOF"}
ErrInvalidBERData = asn1.StructuralError{Msg: "invalid BER data"}
ErrTrailingData = asn1.SyntaxError{Msg: "trailing data"}
ErrUnsupportedLength = asn1.StructuralError{Msg: "length method not supported"}
ErrUnsupportedIndefinedLength = asn1.StructuralError{Msg: "indefinite length not supported"}
)
Expand Down Expand Up @@ -70,7 +70,7 @@ func decode(r []byte) (value, error) {
// primitive value
if isPrimitive(identifier) {
if contentLen != len(r) {
return nil, ErrBytesAtTheEnd
return nil, ErrTrailingData
}
return primitiveValue{
identifier: identifier,
Expand Down Expand Up @@ -135,7 +135,7 @@ func decode(r []byte) (value, error) {
}
}
if len(r) > 0 {
return nil, ErrBytesAtTheEnd
return nil, ErrTrailingData
}
return rootConstructed, nil
}
Expand Down

0 comments on commit f4dc95f

Please sign in to comment.