Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/asn1: support indefinite form #42021

Closed
lxShaDoWxl opened this issue Oct 16, 2020 · 3 comments
Closed

encoding/asn1: support indefinite form #42021

lxShaDoWxl opened this issue Oct 16, 2020 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@lxShaDoWxl
Copy link

Hi! asn1 encode incorrect support ISO/IEC 8825-1:2015
https://www.itu.int/ITU-T/recommendations/rec.aspx?rec=12483&lang=ru

Length octets
Two forms of length octets are specified. These are:
a) the definite form (see 8.1.3.3); and
b) the indefinite form (see 8.1.3.6).

not work form "b"

What version of Go are you using (go version)?

$ go version
go version go1.14.9 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/viktor/.cache/go-build"
GOENV="/home/viktor/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/viktor/main/projects/golang"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/viktor/main/projects/golang/src/incraft/soap-test/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build647107160=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Usage asn1.Unmarshal
https://play.golang.org/p/a1FhCy3nUvj

What did you expect to see?

success unmarshal bytes

What did you see instead?

asn1: syntax error: indefinite length found (not DER)

@lxShaDoWxl lxShaDoWxl changed the title bugs: asn1 encode no supports indefinite form asn1 encode no supports indefinite form Oct 16, 2020
@toothrot toothrot changed the title asn1 encode no supports indefinite form encoding/asn1: support indefinite form Oct 16, 2020
@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 16, 2020
@toothrot toothrot added this to the Backlog milestone Oct 16, 2020
@toothrot
Copy link
Contributor

See also #12267

/cc @FiloSottile @agl

@lxShaDoWxl
Copy link
Author

bad no support BER (Basic Encoding Rules)
it wasn't just called basic))

@FiloSottile
Copy link
Contributor

encoding/asn1 intentionally only implements DER, as that's what almost all cryptography packages that depend on it need.

Package asn1 implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690.

@golang golang locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants