/* 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;
}