提交 d396da33 编写于 作者: M Meena Vyas 提交者: Richard Levitte

Added a new Makefile in demos/evp directory

Fixed compilation warning in file aesgcm.c
Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3406)
上级 e091367d
# Quick instruction:
# To build against an OpenSSL built in the source tree, do this:
#
# make OPENSSL_INCS_LOCATION=-I../../include OPENSSL_LIBS_LOCATION=-L../..
#
# To run the demos when linked with a shared library (default):
#
# LD_LIBRARY_PATH=../.. ./aesccm
# LD_LIBRARY_PATH=../.. ./aesgcm
CFLAGS = $(OPENSSL_INCS_LOCATION)
LDFLAGS = $(OPENSSL_LIBS_LOCATION) -lssl -lcrypto
all: aesccm aesgcm
aesccm: aesccm.o
aesgcm: aesgcm.o
aesccm aesgcm:
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
...@@ -102,7 +102,8 @@ void aes_gcm_decrypt(void) ...@@ -102,7 +102,8 @@ void aes_gcm_decrypt(void)
printf("Plaintext:\n"); printf("Plaintext:\n");
BIO_dump_fp(stdout, outbuf, outlen); BIO_dump_fp(stdout, outbuf, outlen);
/* Set expected tag value. */ /* Set expected tag value. */
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag), gcm_tag); EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag),
(void *)gcm_tag);
/* Finalise: note get no output for GCM */ /* Finalise: note get no output for GCM */
rv = EVP_DecryptFinal_ex(ctx, outbuf, &outlen); rv = EVP_DecryptFinal_ex(ctx, outbuf, &outlen);
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册