mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1495120 - Wire up ESNI r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D7221 --HG-- extra : source : d2edbb87f3d283ab2c2fb6f8ad3408f792a6bd27
This commit is contained in:
parent
85fd583cf2
commit
030f8b7c79
@ -15,6 +15,7 @@
|
||||
#include "ScopedNSSTypes.h"
|
||||
#include "SharedSSLState.h"
|
||||
#include "keyhi.h"
|
||||
#include "mozilla/Base64.h"
|
||||
#include "mozilla/Casting.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Logging.h"
|
||||
@ -1020,16 +1021,22 @@ nsNSSSocketInfo::SetEsniTxt(const nsACString & aEsniTxt)
|
||||
mEsniTxt = aEsniTxt;
|
||||
|
||||
if (mEsniTxt.Length()) {
|
||||
fprintf(stderr,"\n\nTODO - SSL_EnableSNI() [%s] (%d bytes)\n",
|
||||
mEsniTxt.get(), mEsniTxt.Length());
|
||||
|
||||
#if 0
|
||||
if (SECSuccess != SSL_EnableESNI(mFd,
|
||||
reinterpret_cast<const PRUint8*>(mEsniTxt.get()),
|
||||
mEsniTxt.Length(), "dummy.invalid")) {
|
||||
return NS_ERROR_FAILURE;
|
||||
nsAutoCString esniBin;
|
||||
if (NS_OK != Base64Decode(mEsniTxt, esniBin)) {
|
||||
MOZ_LOG(gPIPNSSLog, LogLevel::Error,
|
||||
("[%p] Invalid ESNIKeys record. Couldn't base64 decode\n",
|
||||
(void*) mFd));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (SECSuccess != SSL_EnableESNI(mFd,
|
||||
reinterpret_cast<const PRUint8*>(esniBin.get()),
|
||||
esniBin.Length(), nullptr)) {
|
||||
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("[%p] Invalid ESNIKeys record %s\n",
|
||||
(void*) mFd,
|
||||
PR_ErrorToName(PR_GetError())));
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user