Fix openssl3.0 migration code in sqlcipher 90/299490/1
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 3 Oct 2023 07:32:12 +0000 (09:32 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 3 Oct 2023 07:41:45 +0000 (09:41 +0200)
Calculate the string size using strlen.

Change-Id: I541b656995bdf4f0dada21e6b4b61f91360c8eee

src/manager/sqlcipher/sqlcipher.c

index a6499846e2c7f33dc20b1a60623f5565cdb357ac..9fc409bdc2ea9f56657412aced8f62253d9fbffc 100644 (file)
@@ -25193,7 +25193,7 @@ static int sqlcipher_openssl_hmac(void *ctx, int algorithm, unsigned char *hmac_
     default:
       goto error;
   }
-  params[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, digest_name, sizeof(digest_name));
+  params[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, digest_name, strlen(digest_name));
   params[1] = OSSL_PARAM_construct_end();
 
   if(!EVP_MAC_init(hctx, hmac_key, key_sz, params)) goto error;