forked from wolfSSL/wolfssl
add EVP_MD_CTX_md, EVP_MD_type
This commit is contained in:
committed by
Jacob Barthelmeh
parent
2b3438e11b
commit
5a2794fe9c
61
src/ssl.c
61
src/ssl.c
@@ -2525,7 +2525,7 @@ static struct cipher{
|
|||||||
{ 0, NULL}
|
{ 0, NULL}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
const WOLFSSL_EVP_MD *wolfSSL_EVP_get_cipherbyname(const char *name)
|
const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbyname(const char *name)
|
||||||
{
|
{
|
||||||
|
|
||||||
static const struct alias {
|
static const struct alias {
|
||||||
@@ -10658,34 +10658,37 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
|
|||||||
|
|
||||||
#endif /* WOLFSSL_SHA512 */
|
#endif /* WOLFSSL_SHA512 */
|
||||||
|
|
||||||
const EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name)
|
static struct s_ent{
|
||||||
{
|
const unsigned char macType;
|
||||||
static const char *md_tbl[] = {
|
const char *name;
|
||||||
|
} md_tbl[] = {
|
||||||
#ifndef NO_MD5
|
#ifndef NO_MD5
|
||||||
"MD5",
|
{MD5, "MD5"},
|
||||||
#endif /* NO_MD5 */
|
#endif /* NO_MD5 */
|
||||||
|
|
||||||
#ifndef NO_SHA
|
#ifndef NO_SHA
|
||||||
"SHA",
|
{SHA, "SHA"},
|
||||||
#endif /* NO_SHA */
|
#endif /* NO_SHA */
|
||||||
|
|
||||||
#ifdef WOLFSSL_SHA224
|
#ifdef WOLFSSL_SHA224
|
||||||
"SHA224",
|
{SHA224, "SHA224"},
|
||||||
#endif /* WOLFSSL_SHA224 */
|
#endif /* WOLFSSL_SHA224 */
|
||||||
|
|
||||||
"SHA256",
|
{SHA256, "SHA256"},
|
||||||
|
|
||||||
#ifdef WOLFSSL_SHA384
|
#ifdef WOLFSSL_SHA384
|
||||||
"SHA384",
|
{SHA384, "SHA384"},
|
||||||
#endif /* WOLFSSL_SHA384 */
|
#endif /* WOLFSSL_SHA384 */
|
||||||
|
|
||||||
#ifdef WOLFSSL_SHA512
|
#ifdef WOLFSSL_SHA512
|
||||||
"SHA512",
|
{SHA512, "SHA512"},
|
||||||
#endif /* WOLFSSL_SHA512 */
|
#endif /* WOLFSSL_SHA512 */
|
||||||
|
|
||||||
NULL
|
{0, NULL}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
const WOLFSSL_EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name)
|
||||||
|
{
|
||||||
static const struct alias {
|
static const struct alias {
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *alias;
|
const char *alias;
|
||||||
@@ -10697,7 +10700,7 @@ const EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name)
|
|||||||
};
|
};
|
||||||
|
|
||||||
const struct alias *al ;
|
const struct alias *al ;
|
||||||
const char **tbl ;
|
const struct s_ent *ent ;
|
||||||
|
|
||||||
for( al = alias_tbl; al->name != NULL; al++)
|
for( al = alias_tbl; al->name != NULL; al++)
|
||||||
if(XSTRNCMP(name, al->alias, XSTRLEN(al->alias)+1) == 0) {
|
if(XSTRNCMP(name, al->alias, XSTRLEN(al->alias)+1) == 0) {
|
||||||
@@ -10705,13 +10708,34 @@ const EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( tbl = md_tbl; *tbl != NULL; tbl++)
|
for( ent = md_tbl; ent->name != NULL; ent++)
|
||||||
if(XSTRNCMP(name, *tbl, XSTRLEN(*tbl)+1) == 0) {
|
if(XSTRNCMP(name, ent->name, XSTRLEN(ent->name)+1) == 0) {
|
||||||
return (EVP_MD *)*tbl;
|
return (EVP_MD *)ent->name;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static WOLFSSL_EVP_MD *wolfSSL_EVP_get_md(const unsigned char type)
|
||||||
|
{
|
||||||
|
const struct s_ent *ent ;
|
||||||
|
for( ent = md_tbl; ent->macType != 0; ent++)
|
||||||
|
if(type == ent->macType) {
|
||||||
|
return (WOLFSSL_EVP_MD *)ent->name;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
|
||||||
|
{
|
||||||
|
const struct s_ent *ent ;
|
||||||
|
for( ent = md_tbl; ent->name != NULL; ent++)
|
||||||
|
if(XSTRNCMP((const char *)md, ent->name, XSTRLEN(ent->name)+1) == 0) {
|
||||||
|
return ent->macType;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_MD5
|
#ifndef NO_MD5
|
||||||
|
|
||||||
const WOLFSSL_EVP_MD* wolfSSL_EVP_md5(void)
|
const WOLFSSL_EVP_MD* wolfSSL_EVP_md5(void)
|
||||||
@@ -10801,6 +10825,13 @@ const EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name)
|
|||||||
/* do nothing */
|
/* do nothing */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const WOLFSSL_EVP_MD *wolfSSL_EVP_MD_CTX_md(const WOLFSSL_EVP_MD_CTX *ctx)
|
||||||
|
{
|
||||||
|
if (!ctx)
|
||||||
|
return NULL;
|
||||||
|
return (const WOLFSSL_EVP_MD *)wolfSSL_EVP_get_md(ctx->macType);
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NO_AES
|
#ifndef NO_AES
|
||||||
|
|
||||||
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cbc(void)
|
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cbc(void)
|
||||||
|
146
tmp.options.h
Normal file
146
tmp.options.h
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
/* wolfssl options.h
|
||||||
|
* generated from configure options
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_OPTIONS_H
|
||||||
|
#define WOLFSSL_OPTIONS_H
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef WOLFSSL_AES_COUNTER
|
||||||
|
#define WOLFSSL_AES_COUNTER
|
||||||
|
|
||||||
|
#undef HAVE_AESGCM
|
||||||
|
#define HAVE_AESGCM
|
||||||
|
|
||||||
|
#undef WOLFSSL_AES_DIRECT
|
||||||
|
#define WOLFSSL_AES_DIRECT
|
||||||
|
|
||||||
|
#undef HAVE_AES_CCM
|
||||||
|
#define HAVE_AES_CCM
|
||||||
|
|
||||||
|
#undef HAVE_AES_ECB
|
||||||
|
#define HAVE_AES_ECB
|
||||||
|
|
||||||
|
#undef SHAVE_AES_DECRYPT
|
||||||
|
#define SHAVE_AES_DECRYPT
|
||||||
|
|
||||||
|
#undef OPENSSL_EXTRA
|
||||||
|
#define OPENSSL_EXTRA
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_OPTIONS_IGNORE_SYS
|
||||||
|
#undef _POSIX_THREADS
|
||||||
|
#define _POSIX_THREADS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef DEBUG_WOLFSSL
|
||||||
|
#define DEBUG_WOLFSSL
|
||||||
|
|
||||||
|
#undef HAVE_THREAD_LS
|
||||||
|
#define HAVE_THREAD_LS
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_OPTIONS_IGNORE_SYS
|
||||||
|
#undef _THREAD_SAFE
|
||||||
|
#define _THREAD_SAFE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef TFM_TIMING_RESISTANT
|
||||||
|
#define TFM_TIMING_RESISTANT
|
||||||
|
|
||||||
|
#undef ECC_TIMING_RESISTANT
|
||||||
|
#define ECC_TIMING_RESISTANT
|
||||||
|
|
||||||
|
#undef WC_RSA_BLINDING
|
||||||
|
#define WC_RSA_BLINDING
|
||||||
|
|
||||||
|
#undef HAVE_AESGCM
|
||||||
|
#define HAVE_AESGCM
|
||||||
|
|
||||||
|
#undef WOLFSSL_SHA512
|
||||||
|
#define WOLFSSL_SHA512
|
||||||
|
|
||||||
|
#undef WOLFSSL_SHA384
|
||||||
|
#define WOLFSSL_SHA384
|
||||||
|
|
||||||
|
#undef NO_DSA
|
||||||
|
#define NO_DSA
|
||||||
|
|
||||||
|
#undef HAVE_ECC
|
||||||
|
#define HAVE_ECC
|
||||||
|
|
||||||
|
#undef TFM_ECC256
|
||||||
|
#define TFM_ECC256
|
||||||
|
|
||||||
|
#undef ECC_SHAMIR
|
||||||
|
#define ECC_SHAMIR
|
||||||
|
|
||||||
|
#undef WOLFSSL_BASE64_ENCODE
|
||||||
|
#define WOLFSSL_BASE64_ENCODE
|
||||||
|
|
||||||
|
#undef NO_RC4
|
||||||
|
#define NO_RC4
|
||||||
|
|
||||||
|
#undef NO_HC128
|
||||||
|
#define NO_HC128
|
||||||
|
|
||||||
|
#undef NO_RABBIT
|
||||||
|
#define NO_RABBIT
|
||||||
|
|
||||||
|
#undef WOLFSSL_SHA224
|
||||||
|
#define WOLFSSL_SHA224
|
||||||
|
|
||||||
|
#undef HAVE_POLY1305
|
||||||
|
#define HAVE_POLY1305
|
||||||
|
|
||||||
|
#undef HAVE_ONE_TIME_AUTH
|
||||||
|
#define HAVE_ONE_TIME_AUTH
|
||||||
|
|
||||||
|
#undef HAVE_CHACHA
|
||||||
|
#define HAVE_CHACHA
|
||||||
|
|
||||||
|
#undef HAVE_HASHDRBG
|
||||||
|
#define HAVE_HASHDRBG
|
||||||
|
|
||||||
|
#undef HAVE_TLS_EXTENSIONS
|
||||||
|
#define HAVE_TLS_EXTENSIONS
|
||||||
|
|
||||||
|
#undef HAVE_SUPPORTED_CURVES
|
||||||
|
#define HAVE_SUPPORTED_CURVES
|
||||||
|
|
||||||
|
#undef HAVE_EXTENDED_MASTER
|
||||||
|
#define HAVE_EXTENDED_MASTER
|
||||||
|
|
||||||
|
#undef NO_PSK
|
||||||
|
#define NO_PSK
|
||||||
|
|
||||||
|
#undef NO_MD4
|
||||||
|
#define NO_MD4
|
||||||
|
|
||||||
|
#undef USE_FAST_MATH
|
||||||
|
#define USE_FAST_MATH
|
||||||
|
|
||||||
|
#undef WOLFSSL_X86_64_BUILD
|
||||||
|
#define WOLFSSL_X86_64_BUILD
|
||||||
|
|
||||||
|
#undef NO_DES3
|
||||||
|
#define NO_DES3
|
||||||
|
|
||||||
|
#undef HAVE___UINT128_T
|
||||||
|
#define HAVE___UINT128_T
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* WOLFSSL_OPTIONS_H */
|
||||||
|
|
2403
tmp.status
Executable file
2403
tmp.status
Executable file
File diff suppressed because it is too large
Load Diff
@@ -177,12 +177,13 @@ typedef int WOLFSSL_ENGINE ;
|
|||||||
|
|
||||||
WOLFSSL_API void wolfSSL_EVP_init(void);
|
WOLFSSL_API void wolfSSL_EVP_init(void);
|
||||||
WOLFSSL_API int wolfSSL_EVP_MD_size(const WOLFSSL_EVP_MD* md);
|
WOLFSSL_API int wolfSSL_EVP_MD_size(const WOLFSSL_EVP_MD* md);
|
||||||
|
WOLFSSL_API int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md);
|
||||||
|
|
||||||
WOLFSSL_API WOLFSSL_EVP_MD_CTX *wolfSSL_EVP_MD_CTX_new (void);
|
WOLFSSL_API WOLFSSL_EVP_MD_CTX *wolfSSL_EVP_MD_CTX_new (void);
|
||||||
WOLFSSL_API void wolfSSL_EVP_MD_CTX_free(WOLFSSL_EVP_MD_CTX* ctx);
|
WOLFSSL_API void wolfSSL_EVP_MD_CTX_free(WOLFSSL_EVP_MD_CTX* ctx);
|
||||||
WOLFSSL_API void wolfSSL_EVP_MD_CTX_init(WOLFSSL_EVP_MD_CTX* ctx);
|
WOLFSSL_API void wolfSSL_EVP_MD_CTX_init(WOLFSSL_EVP_MD_CTX* ctx);
|
||||||
WOLFSSL_API int wolfSSL_EVP_MD_CTX_cleanup(WOLFSSL_EVP_MD_CTX* ctx);
|
WOLFSSL_API int wolfSSL_EVP_MD_CTX_cleanup(WOLFSSL_EVP_MD_CTX* ctx);
|
||||||
|
WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_MD_CTX_md(const WOLFSSL_EVP_MD_CTX *ctx);
|
||||||
WOLFSSL_API const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbyname(const char *name);
|
WOLFSSL_API const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbyname(const char *name);
|
||||||
WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name);
|
WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name);
|
||||||
|
|
||||||
@@ -336,8 +337,13 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
|
|||||||
#define EVP_MD_CTX_new wolfSSL_EVP_MD_CTX_new
|
#define EVP_MD_CTX_new wolfSSL_EVP_MD_CTX_new
|
||||||
#define EVP_MD_CTX_create wolfSSL_EVP_MD_CTX_new
|
#define EVP_MD_CTX_create wolfSSL_EVP_MD_CTX_new
|
||||||
#define EVP_MD_CTX_free wolfSSL_EVP_MD_CTX_free
|
#define EVP_MD_CTX_free wolfSSL_EVP_MD_CTX_free
|
||||||
|
#define EVP_MD_CTX_destroy wolfSSL_EVP_MD_CTX_free
|
||||||
#define EVP_MD_CTX_init wolfSSL_EVP_MD_CTX_init
|
#define EVP_MD_CTX_init wolfSSL_EVP_MD_CTX_init
|
||||||
#define EVP_MD_CTX_cleanup wolfSSL_EVP_MD_CTX_cleanup
|
#define EVP_MD_CTX_cleanup wolfSSL_EVP_MD_CTX_cleanup
|
||||||
|
#define EVP_MD_CTX_md wolfSSL_EVP_MD_CTX_md
|
||||||
|
#define EVP_MD_CTX_type wolfSSL_EVP_MD_type
|
||||||
|
#define EVP_MD_type wolfSSL_EVP_MD_type
|
||||||
|
|
||||||
#define EVP_DigestInit wolfSSL_EVP_DigestInit
|
#define EVP_DigestInit wolfSSL_EVP_DigestInit
|
||||||
#define EVP_DigestInit_ex wolfSSL_EVP_DigestInit_ex
|
#define EVP_DigestInit_ex wolfSSL_EVP_DigestInit_ex
|
||||||
#define EVP_DigestUpdate wolfSSL_EVP_DigestUpdate
|
#define EVP_DigestUpdate wolfSSL_EVP_DigestUpdate
|
||||||
|
@@ -107,7 +107,7 @@ typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX;
|
|||||||
strncpy(buf, "Not Implemented, SSLv2 only", len)
|
strncpy(buf, "Not Implemented, SSLv2 only", len)
|
||||||
|
|
||||||
/* @TODO */
|
/* @TODO */
|
||||||
#define ERR_print_errors_fp(file) wolfSSL_print_all_errors_fp((file))
|
#define ERR_print_errors_fp(file) wolfSSL_ERR_print_errors_fp((file))
|
||||||
|
|
||||||
/* at the moment only returns ok */
|
/* at the moment only returns ok */
|
||||||
#define SSL_get_verify_result wolfSSL_get_verify_result
|
#define SSL_get_verify_result wolfSSL_get_verify_result
|
||||||
@@ -320,6 +320,7 @@ typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX;
|
|||||||
#define X509_CRL_verify wolfSSL_X509_CRL_verify
|
#define X509_CRL_verify wolfSSL_X509_CRL_verify
|
||||||
#define X509_STORE_CTX_set_error wolfSSL_X509_STORE_CTX_set_error
|
#define X509_STORE_CTX_set_error wolfSSL_X509_STORE_CTX_set_error
|
||||||
#define X509_OBJECT_free_contents wolfSSL_X509_OBJECT_free_contents
|
#define X509_OBJECT_free_contents wolfSSL_X509_OBJECT_free_contents
|
||||||
|
#define EVP_PKEY_new wolfSSL_PKEY_new
|
||||||
#define EVP_PKEY_free wolfSSL_EVP_PKEY_free
|
#define EVP_PKEY_free wolfSSL_EVP_PKEY_free
|
||||||
#define X509_cmp_current_time wolfSSL_X509_cmp_current_time
|
#define X509_cmp_current_time wolfSSL_X509_cmp_current_time
|
||||||
#define sk_X509_REVOKED_num wolfSSL_sk_X509_REVOKED_num
|
#define sk_X509_REVOKED_num wolfSSL_sk_X509_REVOKED_num
|
||||||
|
Reference in New Issue
Block a user