Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
iked wont crash no more
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdy committed Oct 15, 2020
1 parent 869ad15 commit e3df127
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include(CheckLibraryExists)

include_directories(source/)

set(RELVER "4.2.0")
set(RELVER "2.2.1")

subdirs(
source/iked
Expand Down Expand Up @@ -315,7 +315,7 @@ endif( NOT PATH_INC_PFKEYV2 )
#

OPTION( DEBUG "include Debug Symbol support" )
OPTION( NATT "include NAT Traversal support" )
OPTION( NATT "include NAT Traversal support" ON)
OPTION( LDAP "include LDAP Authentication support" )
OPTION( QTGUI "include Client QT GUI support" )
OPTION( TESTS "include library test programs" )
Expand All @@ -325,6 +325,8 @@ OPTION( SBINDIR "custom sbin install path" )
OPTION( LIBDIR "custom library install path" )
OPTION( MANDIR "custom man page install path" )



# Debug Symbols Option

if( DEBUG )
Expand Down
2 changes: 1 addition & 1 deletion source/iked/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ bool dh_init( long group, DH ** dh_data, long * dh_size )
auto *p = BN_new();
auto *g = BN_new();

DH_set0_pqg(dh, p, nullptr, nullptr);
DH_set0_pqg(dh, p, nullptr, g);
DH_set_length(dh, 0);

//
Expand Down
6 changes: 2 additions & 4 deletions source/iked/ike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ long _IKED::packet_ike_decrypt( IDB_PH1 * sa, PACKET_IKE & packet, BDATA * iv )
// init cipher key and iv
//

EVP_CIPHER_CTX *ctx_cipher;
EVP_CIPHER_CTX_init( ctx_cipher );
EVP_CIPHER_CTX *ctx_cipher = EVP_CIPHER_CTX_new();

EVP_CipherInit_ex(
ctx_cipher,
Expand Down Expand Up @@ -595,8 +594,7 @@ long _IKED::packet_ike_encrypt( IDB_PH1 * sa, PACKET_IKE & packet, BDATA * iv )
// encrypt all but header
//

EVP_CIPHER_CTX *ctx_cipher;
EVP_CIPHER_CTX_init( ctx_cipher );
EVP_CIPHER_CTX *ctx_cipher = EVP_CIPHER_CTX_new();

EVP_CipherInit_ex(
ctx_cipher,
Expand Down
2 changes: 1 addition & 1 deletion source/iked/ike.exch.phase1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ long _IKED::phase1_gen_natd( IDB_PH1 * ph1 )
// compute the nat discovery
// hash for local address
//

ctx_hash = EVP_MD_CTX_new();
EVP_DigestInit( ctx_hash, ph1->evp_hash );
EVP_DigestUpdate( ctx_hash, ph1->cookies.i, ISAKMP_COOKIE_SIZE );
EVP_DigestUpdate( ctx_hash, ph1->cookies.r, ISAKMP_COOKIE_SIZE );
Expand Down

0 comments on commit e3df127

Please sign in to comment.