From 548c4481e261832b642a494bca8c8116ae040c53 Mon Sep 17 00:00:00 2001 From: Junjie Gao Date: Mon, 25 Dec 2023 09:56:57 +0800 Subject: [PATCH] fix: remove common errors Signed-off-by: Junjie Gao --- internal/encoding/asn1/asn1.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/internal/encoding/asn1/asn1.go b/internal/encoding/asn1/asn1.go index 582e1c3f..87a4b833 100644 --- a/internal/encoding/asn1/asn1.go +++ b/internal/encoding/asn1/asn1.go @@ -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. @@ -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