Skip to content

Commit

Permalink
Merge pull request #1201 from riyazdf/pkcs-padding-comment
Browse files Browse the repository at this point in the history
pkcs8: add comment about padding during unmarshal
  • Loading branch information
cyli authored Jul 25, 2017
2 parents 4995826 + 943d9af commit 5b49fb6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tuf/utils/pkcs8.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ func ParsePKCS8ToTufKey(der []byte, password []byte) (data.PrivateKey, error) {
mode := cipher.NewCBCDecrypter(block, iv)
mode.CryptBlocks(encryptedKey, encryptedKey)

// no need to explicitly remove padding, as ASN.1 unmarshalling will automatically discard it
key, err := parsePKCS8ToTufKey(encryptedKey)
if err != nil {
return nil, errors.New("pkcs8: incorrect password")
Expand Down

0 comments on commit 5b49fb6

Please sign in to comment.