summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2005-12-02 13:47:02 +0000
committerDr. Stephen Henson <steve@openssl.org>2005-12-02 13:47:02 +0000
commitcf6bc84148cb15af09b292394aaf2b45f0d5af0d (patch)
treee7f2fe58c0c2715a8709754b2486a6b2a68497f1 /crypto
parent36d51bea93f1056ca20d04c92cc5d4c22a876ab0 (diff)
Update from HEAD.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/evp.h2
-rw-r--r--crypto/evp/evp_enc.c16
2 files changed, 18 insertions, 0 deletions
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h
index e35d472c70..116a12ff94 100644
--- a/crypto/evp/evp.h
+++ b/crypto/evp/evp.h
@@ -580,6 +580,8 @@ int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
+EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void);
+void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a);
int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad);
int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index 22cb6131be..f0b725def6 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -74,6 +74,13 @@ void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx)
/* ctx->cipher=NULL; */
}
+EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
+ {
+ EVP_CIPHER_CTX *ctx=OPENSSL_malloc(sizeof *ctx);
+ if (ctx)
+ EVP_CIPHER_CTX_init(ctx);
+ return ctx;
+ }
int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
const unsigned char *key, const unsigned char *iv, int enc)
@@ -472,6 +479,15 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
return(1);
}
+void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)
+ {
+ if (ctx)
+ {
+ EVP_CIPHER_CTX_cleanup(ctx);
+ OPENSSL_free(ctx);
+ }
+ }
+
int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c)
{
if (c->cipher != NULL)