Commit 9d6fcd42 authored by Todd Short's avatar Todd Short Committed by Richard Levitte
Browse files

Cleanup EVP_CIPH/EP_CTRL duplicate defines



Remove duplicate defines from EVP source files.
Most of them were in evp.h, which is always included.
Add new ones evp_int.h
EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK is now always defined in evp.h, so
remove conditionals on it

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2201)
parent 7928ee4d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2274,7 +2274,6 @@ int speed_main(int argc, char **argv)
#endif

    if (doit[D_EVP]) {
#ifdef EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
        if (multiblock && evp_cipher) {
            if (!
                (EVP_CIPHER_flags(evp_cipher) &
@@ -2291,7 +2290,6 @@ int speed_main(int argc, char **argv)
            ret = 0;
            goto end;
        }
#endif
        for (testnum = 0; testnum < SIZE_NUM; testnum++) {
            if (evp_cipher) {

+2 −18
Original line number Diff line number Diff line
@@ -21,22 +21,6 @@
#include "internal/evp_int.h"
#include "internal/constant_time_locl.h"

#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
# define EVP_CIPH_FLAG_AEAD_CIPHER       0x200000
# define EVP_CTRL_AEAD_TLS1_AAD          0x16
# define EVP_CTRL_AEAD_SET_MAC_KEY       0x17
#endif

#if !defined(EVP_CIPH_FLAG_DEFAULT_ASN1)
# define EVP_CIPH_FLAG_DEFAULT_ASN1 0
#endif

#if !defined(EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)
# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0
#endif

#define TLS1_1_VERSION 0x0302

typedef struct {
    AES_KEY ks;
    SHA_CTX head, tail, md;
@@ -146,7 +130,7 @@ static void sha1_update(SHA_CTX *c, const void *data, size_t len)
# endif
# define SHA1_Update sha1_update

# if !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
# if !defined(OPENSSL_NO_MULTIBLOCK)

typedef struct {
    unsigned int A[8], B[8], C[8], D[8], E[8];
@@ -842,7 +826,7 @@ static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
                return SHA_DIGEST_LENGTH;
            }
        }
# if !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
# if !defined(OPENSSL_NO_MULTIBLOCK)
    case EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE:
        return (int)(5 + 16 + ((arg + 20 + 16) & -16));
    case EVP_CTRL_TLS1_1_MULTIBLOCK_AAD:
+2 −18
Original line number Diff line number Diff line
@@ -22,22 +22,6 @@
#include "internal/constant_time_locl.h"
#include "internal/evp_int.h"

#ifndef EVP_CIPH_FLAG_AEAD_CIPHER
# define EVP_CIPH_FLAG_AEAD_CIPHER       0x200000
# define EVP_CTRL_AEAD_TLS1_AAD          0x16
# define EVP_CTRL_AEAD_SET_MAC_KEY       0x17
#endif

#if !defined(EVP_CIPH_FLAG_DEFAULT_ASN1)
# define EVP_CIPH_FLAG_DEFAULT_ASN1 0
#endif

#if !defined(EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)
# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0
#endif

#define TLS1_1_VERSION 0x0302

typedef struct {
    AES_KEY ks;
    SHA256_CTX head, tail, md;
@@ -142,7 +126,7 @@ static void sha256_update(SHA256_CTX *c, const void *data, size_t len)
# endif
# define SHA256_Update sha256_update

# if !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
# if !defined(OPENSSL_NO_MULTIBLOCK)

typedef struct {
    unsigned int A[8], B[8], C[8], D[8], E[8], F[8], G[8], H[8];
@@ -819,7 +803,7 @@ static int aesni_cbc_hmac_sha256_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
                return SHA256_DIGEST_LENGTH;
            }
        }
# if !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK
# if !defined(OPENSSL_NO_MULTIBLOCK)
    case EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE:
        return (int)(5 + 16 + ((arg + 32 + 16) & -16));
    case EVP_CTRL_TLS1_1_MULTIBLOCK_AAD:
+0 −3
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@

# include "internal/evp_int.h"

/* FIXME: surely this is available elsewhere? */
# define EVP_RC4_KEY_SIZE                16

typedef struct {
    RC4_KEY ks;                 /* working key */
} EVP_RC4_KEY;
+0 −9
Original line number Diff line number Diff line
@@ -21,15 +21,6 @@
# include <openssl/md5.h>
# include "internal/evp_int.h"

# ifndef EVP_CIPH_FLAG_AEAD_CIPHER
#  define EVP_CIPH_FLAG_AEAD_CIPHER       0x200000
#  define EVP_CTRL_AEAD_TLS1_AAD          0x16
#  define EVP_CTRL_AEAD_SET_MAC_KEY       0x17
# endif

/* FIXME: surely this is available elsewhere? */
# define EVP_RC4_KEY_SIZE                16

typedef struct {
    RC4_KEY ks;
    MD5_CTX head, tail, md;
Loading