Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Fixed #ifdef ENABLE_AEAD_API_PREVIEW #2603

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2624,7 +2624,7 @@ bool srt::CUDT::interpretSrtHandshake(const CHandShake& hs,
}
if (*pw_len == 1)
{
#if ENABLE_AEAD_API_PREVIEW
#ifdef ENABLE_AEAD_API_PREVIEW
if (m_pCryptoControl->m_RcvKmState == SRT_KM_S_BADCRYPTOMODE)
{
// Cryptographic modes mismatch. Not acceptable at all.
Expand Down
4 changes: 2 additions & 2 deletions srtcore/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ int srt::CCryptoControl::processSrtMsg_KMREQ(
LOGC(cnlog.Warn, log << "KMREQ/rcv: (snd) Rx process failure - BADSECRET");
break;
case HAICRYPT_ERROR_CIPHER:
#if ENABLE_AEAD_API_PREVIEW
#ifdef ENABLE_AEAD_API_PREVIEW
m_RcvKmState = m_SndKmState = SRT_KM_S_BADCRYPTOMODE;
#else
m_RcvKmState = m_SndKmState = SRT_KM_S_BADSECRET; // Use "bad secret" as a fallback.
Expand Down Expand Up @@ -403,7 +403,7 @@ int srt::CCryptoControl::processSrtMsg_KMRSP(const uint32_t* srtdata, size_t len
m_SndKmState = SRT_KM_S_UNSECURED;
retstatus = 0;
break;
#if ENABLE_AEAD_API_PREVIEW
#ifdef ENABLE_AEAD_API_PREVIEW
case SRT_KM_S_BADCRYPTOMODE:
// The peer expects to use a different cryptographic mode (e.g. AES-GCM, not AES-CTR).
m_RcvKmState = SRT_KM_S_BADCRYPTOMODE;
Expand Down
4 changes: 2 additions & 2 deletions srtcore/srt.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ enum SRT_REJECT_REASON
SRT_REJ_FILTER, // incompatible packet filter
SRT_REJ_GROUP, // incompatible group
SRT_REJ_TIMEOUT, // connection timeout
#if ENABLE_AEAD_API_PREVIEW
#ifdef ENABLE_AEAD_API_PREVIEW
SRT_REJ_CRYPTO, // conflicting cryptographic configurations
#endif

Expand Down Expand Up @@ -645,7 +645,7 @@ enum SRT_KM_STATE
SRT_KM_S_SECURED = 2, // Stream encrypted, keying Material exchanged, decrypting ok.
SRT_KM_S_NOSECRET = 3, // Stream encrypted and no secret to decrypt Keying Material
SRT_KM_S_BADSECRET = 4 // Stream encrypted and wrong secret is used, cannot decrypt Keying Material
#if ENABLE_AEAD_API_PREVIEW
#ifdef ENABLE_AEAD_API_PREVIEW
,SRT_KM_S_BADCRYPTOMODE = 5 // Stream encrypted but wrong ccryptographic mode is used, cannot decrypt. Since v1.6.0.
#endif
};
Expand Down