Skip to content

Commit

Permalink
Merge pull request fullsailor#16 from Requaos/master
Browse files Browse the repository at this point in the history
capture full bytes of non-octet string compound asn1 values found in
  • Loading branch information
jvehent authored Aug 23, 2018
2 parents 90dc71f + 72f7a36 commit ac1f857
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: go
go:
- 1.6
- 1.7
- 1.8
- "1.9"
- "1.10"
- tip
before_install:
- make gettools
Expand Down
2 changes: 1 addition & 1 deletion sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 6 additions & 2 deletions verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac1f857

Please sign in to comment.