diff --git a/crypto/cbcmac/cbcm_pmeth.c b/crypto/cbcmac/cbcm_pmeth.c index f5326b5b..a942127f 100644 --- a/crypto/cbcmac/cbcm_pmeth.c +++ b/crypto/cbcmac/cbcm_pmeth.c @@ -175,7 +175,7 @@ static int pkey_cbcmac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) case EVP_PKEY_CTRL_SET_MAC_KEY: if (!p2 || p1 < 0) return 0; - if (!CMAC_Init(cmctx, p2, p1, NULL, NULL)) + if (!CBCMAC_Init(cmctx, p2, p1, NULL, NULL)) return 0; break; diff --git a/demos/gmssl/selfsign b/demos/gmssl/selfsign new file mode 100755 index 00000000..438c64f2 Binary files /dev/null and b/demos/gmssl/selfsign differ diff --git a/jni/GmSSL.c b/jni/GmSSL.c index 2f9f8221..bdf819ea 100644 --- a/jni/GmSSL.c +++ b/jni/GmSSL.c @@ -690,7 +690,7 @@ jbyteArray JNICALL Java_GmSSL_publicKeyDecrypt(JNIEnv *env, jobject this, goto end; } - if (!EVP_PKEY_encrypt_init(pkctx)) { + if (!EVP_PKEY_decrypt_init(pkctx)) { PRINT_ERROR(); goto end; } @@ -702,7 +702,7 @@ jbyteArray JNICALL Java_GmSSL_publicKeyDecrypt(JNIEnv *env, jobject this, } } - if (!EVP_PKEY_encrypt(pkctx, outbuf, &outlen, inbuf, inlen)) { + if (!EVP_PKEY_decrypt(pkctx, outbuf, &outlen, inbuf, inlen)) { PRINT_ERROR(); goto end; }