- ret=EVP_SealInit(&(ctx->cipher),type,ek,ekl,iv,pubk,npubk);
- if (!ret) goto err;
+ EVP_MD_CTX_init(&ctx->md);
+ if (!EVP_SignInit(&ctx->md,md_type))
+ goto err;
+
+ EVP_CIPHER_CTX_init(&ctx->cipher);
+ ret=EVP_SealInit(&ctx->cipher,type,ek,ekl,iv,pubk,npubk);
+ if (ret <= 0) goto err;