summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_lib.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2012-07-11 23:31:36 +0000
committerjkim <jkim@FreeBSD.org>2012-07-11 23:31:36 +0000
commit532b4084cb8cac5e6d91d42aa6a497dd4ba4a4f5 (patch)
tree0c30591ac90cb5e07a0763793709fd1056b67f57 /crypto/evp/evp_lib.c
parent1554498e64df093a519f9074c3412047f398aa17 (diff)
downloadFreeBSD-src-532b4084cb8cac5e6d91d42aa6a497dd4ba4a4f5.zip
FreeBSD-src-532b4084cb8cac5e6d91d42aa6a497dd4ba4a4f5.tar.gz
Import OpenSSL 1.0.1c.
Approved by: benl (maintainer)
Diffstat (limited to 'crypto/evp/evp_lib.c')
-rw-r--r--crypto/evp/evp_lib.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c
index 9c20061..b180e48 100644
--- a/crypto/evp/evp_lib.c
+++ b/crypto/evp/evp_lib.c
@@ -188,6 +188,11 @@ int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx)
return ctx->cipher->block_size;
}
+int EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl)
+ {
+ return ctx->cipher->do_cipher(ctx,out,in,inl);
+ }
+
const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx)
{
return ctx->cipher;
@@ -198,6 +203,11 @@ unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher)
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)
{
return ctx->app_data;
@@ -213,6 +223,11 @@ int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
return cipher->iv_len;
}
+int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
+ {
+ return ctx->cipher->iv_len;
+ }
+
int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
{
return cipher->key_len;
@@ -223,6 +238,11 @@ int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)
return ctx->key_len;
}
+int EVP_CIPHER_nid(const EVP_CIPHER *cipher)
+ {
+ return cipher->nid;
+ }
+
int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx)
{
return ctx->cipher->nid;
@@ -245,11 +265,23 @@ int EVP_MD_pkey_type(const EVP_MD *md)
int EVP_MD_size(const EVP_MD *md)
{
+ if (!md)
+ {
+ EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
+ return -1;
+ }
return md->md_size;
}
-const EVP_MD * EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
+unsigned long EVP_MD_flags(const EVP_MD *md)
+ {
+ return md->flags;
+ }
+
+const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
{
+ if (!ctx)
+ return NULL;
return ctx->digest;
}
OpenPOWER on IntegriCloud