diff options
author | Rich Salz <rsalz@openssl.org> | 2015-02-02 11:08:16 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-02-02 11:08:16 -0500 |
commit | 7aa0b022460e1a7bfdf5c70e8cd084d916bac012 (patch) | |
tree | 6ae80731638aff40d71fc428520d7dcaec76c60a /demos/evp | |
parent | 5da05a26f21e7c43a156b65b13a9bc968a6c78db (diff) |
Dead code cleanup: crypto/*.c, x509v3, demos
Some of the #if 0 code in demo's was kept, but given helpful #ifdef
names, to show more sample code.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'demos/evp')
-rw-r--r-- | demos/evp/aesgcm.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/demos/evp/aesgcm.c b/demos/evp/aesgcm.c index 9159c5c00f..72028a04a0 100644 --- a/demos/evp/aesgcm.c +++ b/demos/evp/aesgcm.c @@ -85,13 +85,6 @@ void aes_gcm_decrypt(void) EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, sizeof(gcm_iv), NULL); /* Specify key and IV */ EVP_DecryptInit_ex(ctx, NULL, NULL, gcm_key, gcm_iv); -#if 0 - /* - * Set expected tag value. A restriction in OpenSSL 1.0.1c and earlier - * required the tag before any AAD or ciphertext - */ - EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag), gcm_tag); -#endif /* Zero or more calls to specify any AAD */ EVP_DecryptUpdate(ctx, NULL, &outlen, gcm_aad, sizeof(gcm_aad)); /* Decrypt plaintext */ @@ -99,10 +92,7 @@ void aes_gcm_decrypt(void) /* Output decrypted block */ printf("Plaintext:\n"); BIO_dump_fp(stdout, outbuf, outlen); - /* - * Set expected tag value. Works in OpenSSL 1.0.1d and later - * In versions prior to OpenSSL 1.1.0 you should use EVP_CTRL_GCM_SET_TAG - */ + /* Set expected tag value. */ EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag), gcm_tag); /* Finalise: note get no output for GCM */ rv = EVP_DecryptFinal_ex(ctx, outbuf, &outlen); |