summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2018-08-24 19:36:52 +0000
committertb <>2018-08-24 19:36:52 +0000
commit645802590860062ee4cd2e1c571bdeb77a92c722 (patch)
treea8808e097ec2be9caf925e8cab25ab3ed8e84bdf
parent48d82ffdefc51ea4cd8dfa2c1d2572ce0e881ab7 (diff)
downloadopenbsd-645802590860062ee4cd2e1c571bdeb77a92c722.tar.gz
openbsd-645802590860062ee4cd2e1c571bdeb77a92c722.tar.bz2
openbsd-645802590860062ee4cd2e1c571bdeb77a92c722.zip
Provide EVP_CIPHER_CTX_encrypting().
tested in a bulk by sthen ok jsing
-rw-r--r--src/lib/libcrypto/Symbols.list1
-rw-r--r--src/lib/libcrypto/evp/evp.h3
-rw-r--r--src/lib/libcrypto/evp/evp_lib.c8
3 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index eb22f62278..01b21bddc6 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/lib/libcrypto/Symbols.list
@@ -1258,6 +1258,7 @@ EVP_CIPHER_CTX_cleanup
1258EVP_CIPHER_CTX_clear_flags 1258EVP_CIPHER_CTX_clear_flags
1259EVP_CIPHER_CTX_copy 1259EVP_CIPHER_CTX_copy
1260EVP_CIPHER_CTX_ctrl 1260EVP_CIPHER_CTX_ctrl
1261EVP_CIPHER_CTX_encrypting
1261EVP_CIPHER_CTX_flags 1262EVP_CIPHER_CTX_flags
1262EVP_CIPHER_CTX_free 1263EVP_CIPHER_CTX_free
1263EVP_CIPHER_CTX_get_app_data 1264EVP_CIPHER_CTX_get_app_data
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index c6ec0e35d8..b607be7ae5 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/lib/libcrypto/evp/evp.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp.h,v 1.65 2018/08/24 19:30:24 tb Exp $ */ 1/* $OpenBSD: evp.h,v 1.66 2018/08/24 19:36:52 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -491,6 +491,7 @@ unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher);
491#define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) 491#define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE)
492 492
493const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); 493const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx);
494int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx);
494int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); 495int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);
495int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); 496int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
496int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); 497int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
diff --git a/src/lib/libcrypto/evp/evp_lib.c b/src/lib/libcrypto/evp/evp_lib.c
index ad97a3b7b9..3571755620 100644
--- a/src/lib/libcrypto/evp/evp_lib.c
+++ b/src/lib/libcrypto/evp/evp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_lib.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ 1/* $OpenBSD: evp_lib.c,v 1.16 2018/08/24 19:36:52 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -207,6 +207,12 @@ EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx)
207 return ctx->cipher; 207 return ctx->cipher;
208} 208}
209 209
210int
211EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx)
212{
213 return ctx->encrypt;
214}
215
210unsigned long 216unsigned long
211EVP_CIPHER_flags(const EVP_CIPHER *cipher) 217EVP_CIPHER_flags(const EVP_CIPHER *cipher)
212{ 218{