Skip to content

Commit

Permalink
[FAB-3297] PKCS8Info Version should be 0 and not 1
Browse files Browse the repository at this point in the history
The Version field of the PKCSInfo structure can
be 0 or 1 but it turns out that most implementations
actually use 0 and more importantly Java libraries
expect it to be 0 as well.

This corrects the error.  I did not create another
JIRA as I'm just correcting the implementation

Change-Id: Iae7e1771df3654d097c8873d7c3f967afea9fadf
Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
  • Loading branch information
mastersingh24 committed May 1, 2017
1 parent 48cd487 commit d3b7876
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bccsp/utils/keys.go
Expand Up @@ -114,7 +114,7 @@ func PrivateKeyToPEM(privateKey interface{}, pwd []byte) ([]byte, error) {
}

var pkcs8Key pkcs8Info
pkcs8Key.Version = 1
pkcs8Key.Version = 0
pkcs8Key.PrivateKeyAlgorithm = make([]asn1.ObjectIdentifier, 2)
pkcs8Key.PrivateKeyAlgorithm[0] = oidPublicKeyECDSA
pkcs8Key.PrivateKeyAlgorithm[1] = oidNamedCurve
Expand Down

0 comments on commit d3b7876

Please sign in to comment.