Commit 480d3323 authored by Richard Levitte's avatar Richard Levitte
Browse files

Remove EVP_CIPHER_CTX_flags, it's only confusing



EVP_CIPHER_CTX_flags was returning the flags of its associated
EVP_CIPHER.  However, EVP_CIPHER_CTX has flags of its own, so this
function is quite confusing and therefore error prone.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 846ec07d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -212,7 +212,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
        return 0;
        return 0;
    }
    }


    if (!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) {
    if (!(EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & EVP_CIPH_CUSTOM_IV)) {
        switch (EVP_CIPHER_CTX_mode(ctx)) {
        switch (EVP_CIPHER_CTX_mode(ctx)) {


        case EVP_CIPH_STREAM_CIPHER:
        case EVP_CIPH_STREAM_CIPHER:
+0 −5
Original line number Original line Diff line number Diff line
@@ -242,11 +242,6 @@ unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher)
    return cipher->flags;
    return cipher->flags;
}
}


unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx)
{
    return ctx->cipher->flags;
}

void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx)
void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx)
{
{
    return ctx->app_data;
    return ctx->app_data;
+1 −2
Original line number Original line Diff line number Diff line
@@ -526,8 +526,7 @@ void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
void *EVP_CIPHER_CTX_cipher_data(const EVP_CIPHER_CTX *ctx);
void *EVP_CIPHER_CTX_cipher_data(const EVP_CIPHER_CTX *ctx);
void EVP_CIPHER_CTX_new_cipher_data(EVP_CIPHER_CTX *ctx, size_t size);
void EVP_CIPHER_CTX_new_cipher_data(EVP_CIPHER_CTX *ctx, size_t size);
# define EVP_CIPHER_CTX_type(c)         EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
# define EVP_CIPHER_CTX_type(c)         EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
# define EVP_CIPHER_CTX_mode(c)         EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c))
# define EVP_CIPHER_CTX_mode(e)          (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE)


# define EVP_ENCODE_LENGTH(l)    (((l+2)/3*4)+(l/48+1)*2+80)
# define EVP_ENCODE_LENGTH(l)    (((l+2)/3*4)+(l/48+1)*2+80)
# define EVP_DECODE_LENGTH(l)    ((l+3)/4*3+80)
# define EVP_DECODE_LENGTH(l)    ((l+3)/4*3+80)