Skip to content

Commit

Permalink
fix: update code
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Aug 1, 2023
1 parent 45480e5 commit cbce4c1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions internal/encoding/asn1/asn1.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import (

// Common errors
var (
ErrEarlyEOF = asn1.SyntaxError{Msg: "early EOF"}
ErrExpectConstructed = asn1.SyntaxError{Msg: "constructed value expected"}
ErrExpectPrimitive = asn1.SyntaxError{Msg: "primitive value expected"}
ErrUnsupportedLength = asn1.StructuralError{Msg: "length method not supported"}
ErrInvalidSlice = asn1.StructuralError{Msg: "invalid slice"}
ErrInvalidOffset = asn1.StructuralError{Msg: "invalid offset"}
ErrEarlyEOF = asn1.SyntaxError{Msg: "early EOF"}
ErrUnsupportedLength = asn1.StructuralError{Msg: "length method not supported"}
ErrUnsupportedIndefinedLenth = asn1.StructuralError{Msg: "indefinite length not supported"}
ErrInvalidSlice = asn1.StructuralError{Msg: "invalid slice"}
ErrInvalidOffset = asn1.StructuralError{Msg: "invalid offset"}
)

// value represents an ASN.1 value.
Expand Down Expand Up @@ -108,7 +107,7 @@ func decodeLength(r io.ByteReader) (int, error) {
return int(b), nil
case b == 0x80:
// Indefinite-length method is not supported.
return 0, ErrUnsupportedLength
return 0, ErrUnsupportedIndefinedLenth
}

// long form
Expand Down

0 comments on commit cbce4c1

Please sign in to comment.