summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_err.c
diff options
context:
space:
mode:
authortb <>2024-10-28 18:15:53 +0000
committertb <>2024-10-28 18:15:53 +0000
commitc006a5c026da894898b8764743a88da9ed591769 (patch)
tree51d722ec88c22fc4d594e194da21676431b2a72a /src/lib/libcrypto/dsa/dsa_err.c
parentd5d0119ed0fce70c04b0e4f6e89e9f2a1e6b0137 (diff)
downloadopenbsd-c006a5c026da894898b8764743a88da9ed591769.tar.gz
openbsd-c006a5c026da894898b8764743a88da9ed591769.tar.bz2
openbsd-c006a5c026da894898b8764743a88da9ed591769.zip
Fix private key encoding in i2d_ECPrivateKey()
The private key is a random integer between 1 and order - 1. As such it requires at most as many bytes as the order to encode. SEC 1, Section C.4 is very explicit about padding it to this length: The component privateKey is the private key defined to be the octet string of length [ceil(log_2 n/8)] (where n is the order of the curve) obtained from the unsigned integer via the encoding of Section 2.3.7. Fix this by generalizing a similar fix for field elements. ok jsing
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_err.c')
0 files changed, 0 insertions, 0 deletions