Added a new Makefile in demos/evp directory
authorMeena Vyas <meena.vyas@oracle.com>
Mon, 8 May 2017 13:23:01 +0000 (23:23 +1000)
committerRichard Levitte <levitte@openssl.org>
Mon, 8 May 2017 18:09:57 +0000 (20:09 +0200)
Fixed compilation warning in file aesgcm.c

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3406)

demos/evp/Makefile [new file with mode: 0644]
demos/evp/aesgcm.c

diff --git a/demos/evp/Makefile b/demos/evp/Makefile
new file mode 100644 (file)
index 0000000..72c6e81
--- /dev/null
@@ -0,0 +1,20 @@
+# 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 $@ $<
index 17b0ef47484f677a4fa110cfa70015760b112976..df59f469fd866b83f13d9df1126ecef3831d14de 100644 (file)
@@ -102,7 +102,8 @@ void aes_gcm_decrypt(void)
     printf("Plaintext:\n");
     BIO_dump_fp(stdout, outbuf, outlen);
     /* Set expected tag value. */
     printf("Plaintext:\n");
     BIO_dump_fp(stdout, outbuf, outlen);
     /* 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 */
     rv = EVP_DecryptFinal_ex(ctx, outbuf, &outlen);
     /*
     /* Finalise: note get no output for GCM */
     rv = EVP_DecryptFinal_ex(ctx, outbuf, &outlen);
     /*