Minor openssl compatability layer improvements to AES, MD5 and SSL.

This commit is contained in:
David Garske
2017-09-25 11:38:53 -07:00
parent 130e026139
commit aab1e060a0
4 changed files with 33 additions and 7 deletions

View File

@@ -34,6 +34,8 @@
#ifndef NO_AES #ifndef NO_AES
#ifdef WOLFSSL_AES_DIRECT #ifdef WOLFSSL_AES_DIRECT
#include <wolfssl/wolfcrypt/aes.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -63,6 +65,13 @@ WOLFSSL_API void wolfSSL_AES_decrypt
#define wolfSSL_AES_encrypt(in, out, aes) wc_AesEncryptDirect(aes, out, in) #define wolfSSL_AES_encrypt(in, out, aes) wc_AesEncryptDirect(aes, out, in)
#define wolfSSL_AES_decrypt(in, out, aes) wc_AesDecryptDirect(aes, out, in) #define wolfSSL_AES_decrypt(in, out, aes) wc_AesDecryptDirect(aes, out, in)
#ifndef AES_ENCRYPT
#define AES_ENCRYPT AES_ENCRYPTION
#endif
#ifdef AES_DECRYPT
#define AES_DECRYPT AES_DECRYPTION
#endif
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif

View File

@@ -8,6 +8,8 @@
#ifndef NO_MD5 #ifndef NO_MD5
#include <wolfssl/wolfcrypt/hash.h>
#ifdef WOLFSSL_PREFIX #ifdef WOLFSSL_PREFIX
#include "prefix_md5.h" #include "prefix_md5.h"
#endif #endif
@@ -38,6 +40,12 @@ typedef WOLFSSL_MD5_CTX MD5_CTX;
#define MD5Final wolfSSL_MD5_Final #define MD5Final wolfSSL_MD5_Final
#endif #endif
#ifndef MD5
#define MD5(d, n, md) wc_Md5Hash((d), (n), (md))
#endif
#define MD5_DIGEST_LENGTH MD5_DIGEST_SIZE
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif

View File

@@ -629,6 +629,8 @@ typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY;
#define ASN1_STRFLGS_ESC_MSB 4 #define ASN1_STRFLGS_ESC_MSB 4
#define X509_V_ERR_CERT_REJECTED 28 #define X509_V_ERR_CERT_REJECTED 28
#define SSL_MAX_MASTER_KEY_LENGTH 48 /* SECRET_LEN from internal.h */
#define SSL_alert_desc_string_long wolfSSL_alert_desc_string_long #define SSL_alert_desc_string_long wolfSSL_alert_desc_string_long
#define SSL_alert_type_string_long wolfSSL_alert_type_string_long #define SSL_alert_type_string_long wolfSSL_alert_type_string_long
#define SSL_CIPHER_get_bits wolfSSL_CIPHER_get_bits #define SSL_CIPHER_get_bits wolfSSL_CIPHER_get_bits
@@ -801,7 +803,7 @@ typedef WOLFSSL_ASN1_BIT_STRING ASN1_BIT_STRING;
#define SSL_is_server wolfSSL_is_server #define SSL_is_server wolfSSL_is_server
#define SSL_CTX_set1_curves_list wolfSSL_CTX_set1_curves_list #define SSL_CTX_set1_curves_list wolfSSL_CTX_set1_curves_list
#endif #endif /* WOLFSSL_NGINX || WOLFSSL_HAPROXY */
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View File

@@ -570,7 +570,14 @@ WOLFSSL_API void wolfSSL_ERR_error_string_n(unsigned long e, char* buf,
WOLFSSL_API const char* wolfSSL_ERR_reason_error_string(unsigned long); WOLFSSL_API const char* wolfSSL_ERR_reason_error_string(unsigned long);
/* extras */ /* extras */
#ifndef WOLF_STACK_OF
#define WOLF_STACK_OF(x) WOLFSSL_STACK #define WOLF_STACK_OF(x) WOLFSSL_STACK
#endif
#ifndef DECLARE_STACK_OF
#define DECLARE_STACK_OF(x) WOLF_STACK_OF(x);
#endif
WOLFSSL_API int wolfSSL_sk_X509_push(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk, WOLFSSL_API int wolfSSL_sk_X509_push(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk,
WOLFSSL_X509* x509); WOLFSSL_X509* x509);
WOLFSSL_API WOLFSSL_X509* wolfSSL_sk_X509_pop(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk); WOLFSSL_API WOLFSSL_X509* wolfSSL_sk_X509_pop(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk);