Ensure EC private keys retain leading zeros
authorDouglas E Engert <deengert@gmail.com>
Wed, 25 Mar 2015 23:52:28 +0000 (23:52 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 31 Mar 2015 15:38:20 +0000 (16:38 +0100)
commit3d5bb773ecd78f75984fb096bb0be7808d3dc18d
tree6bc5623d562953176f8f1b5a2699f8490cecaede
parentc8ece537e341126b979b185b32fc716db6db9f0c
Ensure EC private keys retain leading zeros

RFC5915 requires the use of the I2OSP primitive as defined in RFC3447
for storing an EC Private Key. This converts the private key into an
OCTETSTRING and retains any leading zeros. This commit ensures that those
leading zeros are present if required.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 30cd4ff294252c4b6a4b69cbef6a5b4117705d22)

Conflicts:
crypto/ec/ec_asn1.c
crypto/ec/ec_asn1.c