From: tb Date: Fri, 24 Aug 2018 19:36:52 +0000 (+0000) Subject: Provide EVP_CIPHER_CTX_encrypting(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7e2fda2b4a25a4d846d0371af8dfb49683d2c68b;p=openbsd Provide EVP_CIPHER_CTX_encrypting(). tested in a bulk by sthen ok jsing --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index eb22f622787..01b21bddc68 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -1258,6 +1258,7 @@ EVP_CIPHER_CTX_cleanup EVP_CIPHER_CTX_clear_flags EVP_CIPHER_CTX_copy EVP_CIPHER_CTX_ctrl +EVP_CIPHER_CTX_encrypting EVP_CIPHER_CTX_flags EVP_CIPHER_CTX_free EVP_CIPHER_CTX_get_app_data diff --git a/lib/libcrypto/evp/evp.h b/lib/libcrypto/evp/evp.h index c6ec0e35d8a..b607be7ae5b 100644 --- a/lib/libcrypto/evp/evp.h +++ b/lib/libcrypto/evp/evp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp.h,v 1.65 2018/08/24 19:30:24 tb Exp $ */ +/* $OpenBSD: evp.h,v 1.66 2018/08/24 19:36:52 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -491,6 +491,7 @@ unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); #define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); diff --git a/lib/libcrypto/evp/evp_lib.c b/lib/libcrypto/evp/evp_lib.c index ad97a3b7b92..3571755620b 100644 --- a/lib/libcrypto/evp/evp_lib.c +++ b/lib/libcrypto/evp/evp_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_lib.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: evp_lib.c,v 1.16 2018/08/24 19:36:52 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -207,6 +207,12 @@ EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) return ctx->cipher; } +int +EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx) +{ + return ctx->encrypt; +} + unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher) {