mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 04:02:15 +02:00
Ported tlsprf to CommonCrypto.
This commit is contained in:
parent
713fbab110
commit
d0e1d06812
@ -115,6 +115,9 @@ namespace openvpn {
|
||||
OPENVPN_DIGEST_DECLARE(SHA512);
|
||||
}
|
||||
|
||||
const EVP_MD *EVP_md5() { return &apple_digest::MD5; }
|
||||
const EVP_MD *EVP_sha1() { return &apple_digest::SHA1; }
|
||||
|
||||
inline const EVP_MD *EVP_get_digestbyname(const char *name)
|
||||
{
|
||||
OPENVPN_DIGEST_SELECT(MD5);
|
||||
|
@ -218,12 +218,12 @@ namespace openvpn {
|
||||
unsigned char *out, const size_t out_size,
|
||||
const unsigned char *in, const size_t in_size)
|
||||
{
|
||||
int outlen = out_size;
|
||||
EVP_CIPHER_CTX *c = ctx();
|
||||
if (out_size < output_size(in_size))
|
||||
throw cipher_output_buffer();
|
||||
if (!EVP_CipherInit_ex (c, NULL, NULL, NULL, iv, -1))
|
||||
throw cipher_init();
|
||||
int outlen = out_size;
|
||||
if (!EVP_CipherUpdate (c, out, &outlen, in, int(in_size)))
|
||||
throw cipher_update();
|
||||
int tmplen = out_size - outlen;
|
||||
|
@ -7,6 +7,8 @@
|
||||
#else
|
||||
#include <openssl/objects.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/md5.h>
|
||||
#include <openssl/sha.h>
|
||||
#endif
|
||||
|
||||
#endif // OPENVPN_GENCRYPTO_EVPDIGEST_H
|
||||
|
@ -3,13 +3,9 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/hmac.h>
|
||||
#include <openssl/md5.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include <openvpn/buffer/buffer.hpp>
|
||||
#include <openvpn/ssl/psid.hpp>
|
||||
#include <openvpn/gencrypto/evphmac.hpp>
|
||||
|
||||
namespace openvpn {
|
||||
namespace tls_prf {
|
||||
|
@ -19,6 +19,9 @@ else
|
||||
CRYPTO_LIBS="-DUSE_OPENSSL -lcrypto -lssl"
|
||||
fi
|
||||
|
||||
# remove previous build
|
||||
rm -f $1
|
||||
|
||||
if [ "$DEBUG" ]; then
|
||||
# debug build
|
||||
g++ -Wall -g -pthread $GCC_EXTRA -I$BOOST -I$OVPN3 -L$BOOST/stage/lib $1.cpp -o $1 -lboost_system $CRYPTO_LIBS
|
||||
|
Loading…
Reference in New Issue
Block a user