Use supplied ENGINE when initialising CMAC. Restore pctx setting.
[openssl.git] / crypto / cmac / cm_pmeth.c
index 585fc8e4bb7266baac3d25949c863fcb29ef92aa..c581e789f7a0cf4bcc25fe74b43497e9cc830882 100644 (file)
@@ -138,7 +138,7 @@ static int pkey_cmac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
                break;
 
                case EVP_PKEY_CTRL_CIPHER:
-               if (!CMAC_Init(cmctx, NULL, 0, p2, NULL))
+               if (!CMAC_Init(cmctx, NULL, 0, p2, ctx->engine))
                        return 0;
                break;