From 9683f890944ffb114f5f8214f694e0b339cf5a5a Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Iniesta Date: Thu, 22 Jun 2017 13:16:46 +0200 Subject: New upstream version 2.4.3 --- src/openvpn/crypto_backend.h | 55 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) (limited to 'src/openvpn/crypto_backend.h') diff --git a/src/openvpn/crypto_backend.h b/src/openvpn/crypto_backend.h index 2c79baa..b7f519b 100644 --- a/src/openvpn/crypto_backend.h +++ b/src/openvpn/crypto_backend.h @@ -17,10 +17,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program (see the file COPYING included with this - * distribution); if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** @@ -47,6 +46,12 @@ /* Maximum HMAC digest size (bytes) */ #define OPENVPN_MAX_HMAC_SIZE 64 +/** Types referencing specific message digest hashing algorithms */ +typedef enum { + MD_SHA1, + MD_SHA256 +} hash_algo_type ; + /** Struct used in cipher name translation table */ typedef struct { const char *openvpn_name; /**< Cipher name used by OpenVPN */ @@ -294,6 +299,20 @@ bool cipher_kt_mode_aead(const cipher_kt_t *cipher); * */ +/** + * Allocate a new cipher context + * + * @return a new cipher context + */ +cipher_ctx_t *cipher_ctx_new(void); + +/** + * Free a cipher context + * + * @param ctx Cipher context. + */ +void cipher_ctx_free(cipher_ctx_t *ctx); + /** * Initialise a cipher context, based on the given key and key type. * @@ -501,6 +520,20 @@ int md_kt_size(const md_kt_t *kt); */ int md_full(const md_kt_t *kt, const uint8_t *src, int src_len, uint8_t *dst); +/* + * Allocate a new message digest context + * + * @return a new zeroed MD context + */ +md_ctx_t *md_ctx_new(void); + +/* + * Free an existing, non-null message digest context + * + * @param ctx Message digest context + */ +void md_ctx_free(md_ctx_t *ctx); + /* * Initialises the given message digest context. * @@ -549,6 +582,20 @@ void md_ctx_final(md_ctx_t *ctx, uint8_t *dst); * */ +/* + * Create a new HMAC context + * + * @return A new HMAC context + */ +hmac_ctx_t *hmac_ctx_new(void); + +/* + * Free an existing HMAC context + * + * @param ctx HMAC context to free + */ +void hmac_ctx_free(hmac_ctx_t *ctx); + /* * Initialises the given HMAC context, using the given digest * and key. -- cgit v1.2.3