Change OSSL_PARAM return size to not be a pointer.
[openssl.git] / providers / default / digests / md5_sha1_prov.c
index 59a7df83ff6d97cb9976ea49120a221189520e89..490134e7ebe851a92092e5cbc24fdc07a9e5d6a5 100644 (file)
@@ -22,20 +22,14 @@ static OSSL_OP_digest_set_params_fn md5_sha1_set_params;
 /* Special set_params method for SSL3 */
 static int md5_sha1_set_params(void *vctx, const OSSL_PARAM params[])
 {
-    int cmd = 0;
-    size_t msg_len = 0;
-    const void *msg = NULL;
     const OSSL_PARAM *p;
     MD5_SHA1_CTX *ctx = (MD5_SHA1_CTX *)vctx;
 
     if (ctx != NULL && params != NULL) {
-        p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_CMD);
-        if (p != NULL && !OSSL_PARAM_get_int(p, &cmd))
-            return 0;
-        p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_MSG);
-        if (p != NULL && !OSSL_PARAM_get_octet_ptr(p, &msg, &msg_len))
-            return 0;
-        return md5_sha1_ctrl(ctx, cmd, msg_len, (void *)msg);
+        p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SSL3_MS);
+        if (p != NULL && p->data_type == OSSL_PARAM_OCTET_STRING)
+            return md5_sha1_ctrl(ctx, EVP_CTRL_SSL3_MASTER_SECRET, p->data_size,
+                                 p->data);
     }
     return 0;
 }