summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2018-06-14 18:03:59 +0000
committerjsing <>2018-06-14 18:03:59 +0000
commit42bf5f3015e094bb3fe0e70ffb41eb6f5e09cbfc (patch)
tree11dee9aef92e765ec3d5839bd6ebc0f1c4c470e4
parentec5ae7b7159857fa56f3374da69bcf274ba700c8 (diff)
downloadopenbsd-42bf5f3015e094bb3fe0e70ffb41eb6f5e09cbfc.tar.gz
openbsd-42bf5f3015e094bb3fe0e70ffb41eb6f5e09cbfc.tar.bz2
openbsd-42bf5f3015e094bb3fe0e70ffb41eb6f5e09cbfc.zip
Clarify the digest truncation comment in DSA signature generation.
Requested by and ok tb@
-rw-r--r--src/lib/libcrypto/dsa/dsa_ossl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c
index 9545cff5f8..2f7268839e 100644
--- a/src/lib/libcrypto/dsa/dsa_ossl.c
+++ b/src/lib/libcrypto/dsa/dsa_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_ossl.c,v 1.35 2018/06/14 17:15:41 jsing Exp $ */ 1/* $OpenBSD: dsa_ossl.c,v 1.36 2018/06/14 18:03:59 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -118,8 +118,9 @@ dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
118 goto err; 118 goto err;
119 119
120 /* 120 /*
121 * If the digest length is greater than the size of q use the 121 * If the digest length is greater than N (the bit length of q), the
122 * BN_num_bits(dsa->q) leftmost bits of the digest, see FIPS 186-3, 4.2. 122 * leftmost N bits of the digest shall be used, see FIPS 186-3, 4.2.
123 * In this case the digest length is given in bytes.
123 */ 124 */
124 if (dlen > BN_num_bytes(dsa->q)) 125 if (dlen > BN_num_bytes(dsa->q))
125 dlen = BN_num_bytes(dsa->q); 126 dlen = BN_num_bytes(dsa->q);