cgmnlm

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/cgmnlm.git
Log | Files | Refs | README | LICENSE

commit dcc0484a8c238acdbe988a898cf2deeac4f34ae5
parent 8c473eda5e4c6537058d0ff1815f2943e7b41498
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 27 Sep 2020 18:06:51 -0400

Fix truncated hashes in known_hosts

Diffstat:
Msrc/tofu.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/tofu.c b/src/tofu.c @@ -53,13 +53,13 @@ verify_callback(X509_STORE_CTX *ctx, void *data) goto invalid_cert; } - unsigned char md[256 / 8]; + unsigned char md[512 / 8]; const EVP_MD *sha512 = EVP_sha512(); unsigned int len = sizeof(md); rc = X509_digest(cert, sha512, md, &len); assert(rc == 1); - char fingerprint[256 / 8 * 3]; + char fingerprint[512 / 8 * 3]; for (size_t i = 0; i < sizeof(md); ++i) { snprintf(&fingerprint[i * 3], 4, "%02X%s", md[i], i + 1 == sizeof(md) ? "" : ":");