From 0acf83caa45c8db1a5b4ed1229bc216ff1ca53fd Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 7 Aug 2018 14:38:35 -0400 Subject: [PATCH 1/4] capture full bytes of non-octet string compound asn1 values found in --- verify.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/verify.go b/verify.go index c26467e..6e1c117 100644 --- a/verify.go +++ b/verify.go @@ -130,8 +130,12 @@ func parseSignedData(data []byte) (*PKCS7, error) { } // Compound octet string if compound.IsCompound { - if _, err = asn1.Unmarshal(compound.Bytes, &content); err != nil { - return nil, err + if compound.Tag == 4 { + if _, err = asn1.Unmarshal(compound.Bytes, &content); err != nil { + return nil, err + } + } else { + content = compound.Bytes } } else { // assuming this is tag 04 From 908247eb6d5d3f4ab60f8f1a8f788e20f220fbc8 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 8 Aug 2018 09:32:06 -0400 Subject: [PATCH 2/4] resolve S1005 error for equivalent loop --- sign.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sign.go b/sign.go index e2468a7..edde358 100644 --- a/sign.go +++ b/sign.go @@ -231,7 +231,7 @@ func (sd *SignedData) Finish() ([]byte, error) { // RemoveAuthenticatedAttributes removes authenticated attributes from signedData // similar to OpenSSL's PKCS7_NOATTR or -noattr flags func (sd *SignedData) RemoveAuthenticatedAttributes() error { - for i, _ := range sd.sd.SignerInfos { + for i := range sd.sd.SignerInfos { blankAttrs := &attributes{} finalBlankAttrs, err := blankAttrs.ForMarshalling() if err != nil { From 45ba75c75d72eafdd4175f1e02d8acefd888fbec Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 8 Aug 2018 09:35:35 -0400 Subject: [PATCH 3/4] updating build matrix in travis config --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82d803c..3771b81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,10 @@ language: go go: - - 1.6 - - 1.7 - - 1.8 + - "1.6" + - "1.7" + - "1.8" + - "1.9" + - "1.10" - tip before_install: - make gettools From 72f7a368e44a75af175703589b6c8f65bad47748 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 8 Aug 2018 09:42:35 -0400 Subject: [PATCH 4/4] usage of `types.SizesFor` breaks backwards compatibility with go1.8 and below --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3771b81..a0c5c6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,5 @@ language: go go: - - "1.6" - - "1.7" - - "1.8" - "1.9" - "1.10" - tip