diff options
author | Richard Levitte <levitte@openssl.org> | 2015-12-13 16:03:02 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-01-12 13:52:22 +0100 |
commit | 8baf9968dfd8ef2bc20cf2bf3de09304eb2213c5 (patch) | |
tree | 2035740aa74629fb0d7fe7a3abd2c7d520ad081d /crypto/evp/evp_locl.h | |
parent | bd4850df648bee9d8e0595b7e1147266e6f55a3e (diff) | |
download | openssl-8baf9968dfd8ef2bc20cf2bf3de09304eb2213c5.zip openssl-8baf9968dfd8ef2bc20cf2bf3de09304eb2213c5.tar.gz openssl-8baf9968dfd8ef2bc20cf2bf3de09304eb2213c5.tar.bz2 |
Make EVP_CIPHER_CTX opaque and renew the creator / destructor functions
Following the method used for EVP_MD_CTX and HMAC_CTX,
EVP_CIPHER_CTX_init and EVP_CIPHER_CTX_cleanup are joined together
into one function, EVP_CIPHER_CTX_reset, with EVP_CIPHER_CTX_init kept
as an alias.
EVP_CIPHER_CTX_cleanup fills no purpose of its own any more and is
therefore removed.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/evp/evp_locl.h')
-rw-r--r-- | crypto/evp/evp_locl.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_locl.h index 1c879b4..8e0e99e 100644 --- a/crypto/evp/evp_locl.h +++ b/crypto/evp/evp_locl.h @@ -71,6 +71,26 @@ struct evp_md_ctx_st { int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count); } /* EVP_MD_CTX */ ; +struct evp_cipher_ctx_st { + const EVP_CIPHER *cipher; + ENGINE *engine; /* functional reference if 'cipher' is + * ENGINE-provided */ + int encrypt; /* encrypt or decrypt */ + int buf_len; /* number we have left */ + unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ + unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ + unsigned char buf[EVP_MAX_BLOCK_LENGTH]; /* saved partial block */ + int num; /* used by cfb/ofb/ctr mode */ + /* FIXME: Should this even exist? It appears unused */ + void *app_data; /* application stuff */ + int key_len; /* May change for variable length cipher */ + unsigned long flags; /* Various flags */ + void *cipher_data; /* per EVP data */ + int final_used; + int block_mask; + unsigned char final[EVP_MAX_BLOCK_LENGTH]; /* possible final block */ +} /* EVP_CIPHER_CTX */ ; + /* Macros to code block cipher wrappers */ /* Wrapper functions for each cipher mode */ |