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 3, 2023
1 parent 22afdf8 commit f916316
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/encoding/asn1/asn1.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func decode(r []byte) (value, error) {
}

// primitive value
if isPrimitive(identifier[0]) {
if isPrimitive(identifier) {
if contentLen != len(r) {
return nil, ErrBytesAtTheEnd
}
Expand Down Expand Up @@ -110,7 +110,7 @@ func decode(r []byte) (value, error) {
if err != nil {
return nil, err
}
if isPrimitive(identifier[0]) {
if isPrimitive(identifier) {
// primitive value
pv := primitiveValue{
identifier: identifier,
Expand Down Expand Up @@ -230,6 +230,6 @@ func decodeLength(r []byte) (int, []byte, error) {

// isPrimitive returns true if the first identifier octet is marked
// as primitive.
func isPrimitive(b byte) bool {
return b&0x20 == 0
func isPrimitive(identifier []byte) bool {
return identifier[0]&0x20 == 0
}

0 comments on commit f916316

Please sign in to comment.