diff options
author | tb <> | 2018-08-24 19:36:52 +0000 |
---|---|---|
committer | tb <> | 2018-08-24 19:36:52 +0000 |
commit | 645802590860062ee4cd2e1c571bdeb77a92c722 (patch) | |
tree | a8808e097ec2be9caf925e8cab25ab3ed8e84bdf | |
parent | 48d82ffdefc51ea4cd8dfa2c1d2572ce0e881ab7 (diff) | |
download | openbsd-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.list | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/evp.h | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/evp_lib.c | 8 |
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 | |||
1258 | EVP_CIPHER_CTX_clear_flags | 1258 | EVP_CIPHER_CTX_clear_flags |
1259 | EVP_CIPHER_CTX_copy | 1259 | EVP_CIPHER_CTX_copy |
1260 | EVP_CIPHER_CTX_ctrl | 1260 | EVP_CIPHER_CTX_ctrl |
1261 | EVP_CIPHER_CTX_encrypting | ||
1261 | EVP_CIPHER_CTX_flags | 1262 | EVP_CIPHER_CTX_flags |
1262 | EVP_CIPHER_CTX_free | 1263 | EVP_CIPHER_CTX_free |
1263 | EVP_CIPHER_CTX_get_app_data | 1264 | EVP_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 | ||
493 | const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); | 493 | const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); |
494 | int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); | ||
494 | int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); | 495 | int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); |
495 | int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); | 496 | int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); |
496 | int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); | 497 | int 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 | ||
210 | int | ||
211 | EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx) | ||
212 | { | ||
213 | return ctx->encrypt; | ||
214 | } | ||
215 | |||
210 | unsigned long | 216 | unsigned long |
211 | EVP_CIPHER_flags(const EVP_CIPHER *cipher) | 217 | EVP_CIPHER_flags(const EVP_CIPHER *cipher) |
212 | { | 218 | { |