Skip to content

Commit

Permalink
fix: remove common errors
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Dec 26, 2023
1 parent 9e8a32e commit 548c448
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions internal/encoding/asn1/asn1.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ import (
"fmt"
)

// Common errors
var (
// ErrUnsupportedIndefiniteLength indicates that the indefinite-length
// method is not supported
ErrUnsupportedIndefiniteLength = asn1.StructuralError{Msg: "indefinite length not supported"}
)

// value is the interface for an ASN.1 value node.
type value interface {
// EncodeMetadata encodes the identifier and length in DER to the buffer.
Expand Down Expand Up @@ -268,7 +261,7 @@ func decodeLength(r []byte) (int, []byte, error) {
} else if b == 0x80 {
// Indefinite-length method is not supported.
// Reference: ISO/IEC 8825-1: 8.1.3.6.1
return 0, nil, ErrUnsupportedIndefiniteLength
return 0, nil, asn1.StructuralError{Msg: "indefinite length not supported"}
}

// long form
Expand Down

0 comments on commit 548c448

Please sign in to comment.