0
0
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:
James Yonan 2011-11-23 03:35:51 +00:00
parent 713fbab110
commit d0e1d06812
5 changed files with 10 additions and 6 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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 {

View File

@ -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