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

Commit

Permalink
Server/Crypto: Load Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
AriDEV3 committed Jan 7, 2024
1 parent 1ee55f5 commit da7a5fe
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ endif()

include(CheckPlatform)

set(OPENSSL_EXPECTED_VERSION 1.1.1)
set(OPENSSL_EXPECTED_VERSION 3.3.0)
set(ACE_EXPECTED_VERSION 6.4.5)

find_package(PCHSupport)
Expand Down
2 changes: 1 addition & 1 deletion src/server/authserver/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* This file contains the main program for the
* authentication server
*/

#pragma comment (lib, "Crypt32")
#include <ace/Dev_Poll_Reactor.h>
#include <ace/TP_Reactor.h>
#include <ace/ACE.h>
Expand Down
11 changes: 10 additions & 1 deletion src/server/shared/Cryptography/ARC4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@

#include "ARC4.h"
#include <openssl/sha.h>
#include <openssl/provider.h>

ARC4::ARC4() : m_ctx(EVP_CIPHER_CTX_new())
{
#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) && (OPENSSL_VERSION_MINOR >= 3)
OSSL_PROVIDER_load(NULL, "legacy");
#endif

#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) && (OPENSSL_VERSION_MINOR < 3)
#error "UNSUPORTED OPENSSL VERSION, SKYFIRE REQUIRES 3.3 or newer."
#endif

EVP_CIPHER_CTX_reset(m_ctx);
EVP_EncryptInit_ex(m_ctx, EVP_rc4(), NULL, NULL, NULL);
}

ARC4::~ARC4()
{
EVP_CIPHER_CTX_reset(m_ctx);
EVP_CIPHER_CTX_free(m_ctx);
}

void ARC4::Init(uint8* seed, uint32 len)
Expand Down
2 changes: 1 addition & 1 deletion src/server/worldserver/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// \addtogroup Trinityd Skyfire Daemon
/// @{
/// \file

#pragma comment (lib, "Crypt32")
#include <openssl/opensslv.h>
#include <openssl/crypto.h>
#include <ace/Version.h>
Expand Down

1 comment on commit da7a5fe

@Rosley
Copy link

@Rosley Rosley commented on da7a5fe Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this meant to prep for the upcoming release of OpenSSL 3.3, or did you mean to put an earlier (and available to the public) version of OpenSSL?

Please sign in to comment.