Skip to content

Commit

Permalink
Silence OpenSSL RC4 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Aug 27, 2023
1 parent c88011c commit 02117ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ static void Rc4Codec (
) {
// RC4 uses the same algorithm to both encrypt and decrypt
uint8_t * temp = (uint8_t *)malloc(bytes);

IGNORE_WARNINGS_BEGIN("deprecated-declarations")
RC4((RC4_KEY *)key->handle, bytes, (const unsigned char *)data, temp);
IGNORE_WARNINGS_END

memcpy(data, temp, bytes);

free(temp);
Expand All @@ -119,8 +123,11 @@ CryptKey * CryptKeyCreate (
CryptKey * key = nullptr;
switch (algorithm) {
case kCryptRc4: {
IGNORE_WARNINGS_BEGIN("deprecated-declarations")
RC4_KEY * rc4 = new RC4_KEY;
RC4_set_key(rc4, bytes, (const unsigned char *)data);
IGNORE_WARNINGS_END

key = new CryptKey;
key->algorithm = kCryptRc4;
key->handle = rc4;
Expand Down

0 comments on commit 02117ff

Please sign in to comment.