1 --- openssh-8.9p1/regress/misc/sk-dummy/sk-dummy.c.orig 2022-02-23 12:31:11.000000000 +0100
2 +++ openssh-8.9p1/regress/misc/sk-dummy/sk-dummy.c 2022-03-16 08:49:30.708560186 +0100
9 uint8_t apphash[SHA256_DIGEST_LENGTH];
10 uint8_t sighash[SHA256_DIGEST_LENGTH];
14 /* Prepare data to be signed */
15 dump("message", message, message_len);
17 - SHA256Update(&ctx, (const u_char *)application, strlen(application));
18 - SHA256Final(apphash, &ctx);
20 + SHA256_Update(&ctx, (const u_char *)application, strlen(application));
21 + SHA256_Final(apphash, &ctx);
22 dump("apphash", apphash, sizeof(apphash));
23 countbuf[0] = (counter >> 24) & 0xff;
24 countbuf[1] = (counter >> 16) & 0xff;
26 countbuf[3] = counter & 0xff;
27 dump("countbuf", countbuf, sizeof(countbuf));
28 dump("flags", &flags, sizeof(flags));
30 - SHA256Update(&ctx, apphash, sizeof(apphash));
31 - SHA256Update(&ctx, &flags, sizeof(flags));
32 - SHA256Update(&ctx, countbuf, sizeof(countbuf));
33 - SHA256Update(&ctx, message, message_len);
34 - SHA256Final(sighash, &ctx);
36 + SHA256_Update(&ctx, apphash, sizeof(apphash));
37 + SHA256_Update(&ctx, &flags, sizeof(flags));
38 + SHA256_Update(&ctx, countbuf, sizeof(countbuf));
39 + SHA256_Update(&ctx, message, message_len);
40 + SHA256_Final(sighash, &ctx);
41 dump("sighash", sighash, sizeof(sighash));
42 /* create and encode signature */
43 if ((sig = ECDSA_do_sign(sighash, sizeof(sighash), ec)) == NULL) {
50 uint8_t apphash[SHA256_DIGEST_LENGTH];
51 uint8_t signbuf[sizeof(apphash) + sizeof(flags) +
52 sizeof(counter) + SHA256_DIGEST_LENGTH];
55 /* Prepare data to be signed */
56 dump("message", message, message_len);
58 - SHA256Update(&ctx, (const u_char *)application, strlen(application));
59 - SHA256Final(apphash, &ctx);
61 + SHA256_Update(&ctx, (const u_char *)application, strlen(application));
62 + SHA256_Final(apphash, &ctx);
63 dump("apphash", apphash, sizeof(apphash));
65 memcpy(signbuf, apphash, sizeof(apphash));
68 struct sk_sign_response *response = NULL;
69 int ret = SSH_SK_ERR_GENERAL;
74 if (sign_response == NULL) {
76 skdebug(__func__, "calloc response failed");
80 - SHA256Update(&ctx, data, datalen);
81 - SHA256Final(message, &ctx);
83 + SHA256_Update(&ctx, data, datalen);
84 + SHA256_Final(message, &ctx);
85 response->flags = flags;
86 response->counter = 0x12345678;