From: djm Date: Fri, 1 Oct 2021 04:50:36 +0000 (+0000) Subject: unbreak FIDO sk-ed25519 key enrollment for OPENSSL=no builds; X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9424a71b73f6cffd43002fa188018728b643b2c8;p=openbsd unbreak FIDO sk-ed25519 key enrollment for OPENSSL=no builds; ok dtucker@ --- diff --git a/usr.bin/ssh/sk-usbhid.c b/usr.bin/ssh/sk-usbhid.c index 3e6ab45148e..440d4bc5339 100644 --- a/usr.bin/ssh/sk-usbhid.c +++ b/usr.bin/ssh/sk-usbhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sk-usbhid.c,v 1.30 2021/05/31 06:48:42 djm Exp $ */ +/* $OpenBSD: sk-usbhid.c,v 1.31 2021/10/01 04:50:36 djm Exp $ */ /* * Copyright (c) 2019 Markus Friedl * Copyright (c) 2020 Pedro Martelletto @@ -277,6 +277,8 @@ sha256_mem(const void *m, size_t mlen, u_char *d, size_t dlen) { #ifdef WITH_OPENSSL u_int mdlen; +#else + SHA2_CTX ctx; #endif if (dlen != 32) @@ -286,7 +288,9 @@ sha256_mem(const void *m, size_t mlen, u_char *d, size_t dlen) if (!EVP_Digest(m, mlen, d, &mdlen, EVP_sha256(), NULL)) return -1; #else - SHA256Data(m, mlen, d); + SHA256Init(&ctx); + SHA256Update(&ctx, (const uint8_t *)m, mlen); + SHA256Final(d, &ctx); #endif return 0; }