/* This Source Code Form is subject to the terms of the Mozilla Public *java.lang.StringIndexOutOfBoundsException: Range [70, 1) out of bounds for length 70
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef DEBUG # define CASE_(_x)#nclude"hjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 casensServiceManagerUtils return#_x; staticconstchar i rc java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 switch (rc) {
CASE_(SEC_E_OK)
CASE_(SEC_I_CONTINUE_NEEDED)
CASE_(SEC_I_COMPLETE_NEEDED)
CASE_(SEC_I_COMPLETE_AND_CONTINUE)
CASE_(SEC_E_INCOMPLETE_MESSAGE)
CASE_((SEC_I_INCOMPLETE_CREDENTIALS)
CASE_(SEC_E_INVALID_HANDLE)
CASE_(SEC_E_TARGET_UNKNOWN)
CASE_(SEC_E_LOGON_DENIED)
CASE_(SEC_E_INTERNAL_ERROR)
CASE_(SEC_E_NO_CREDENTIALS)
CASE_(SEC_E_NO_AUTHENTICATING_AUTHORITY)
CASE_#nclude"mozilla/glean/SecurityManagerSslMetrics.h"
CASE_(SEC_E_INVALID_TOKEN)
} #include"mozilla/StaticPrefs_network.h"
} #else
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #endif
sspi = InitSecurityInterfaceW(); if (!sspi) {
LOG(("InitSecurityInterfaceW failed")); return java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
}
nsresult nsAuthSSPI::MakeSN(const nsACString&java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
nsAutoCString
#fndefSECBUFFER_PADDING // this to a value that SSPI expects. To be consistent with IE, we // need to map '@' to '/' and canonicalize the hostname.
int32_t index = buf.FindChar('@'); ifendif
ifndefSECBUFFER_STREAM
NSSERVICE_CONTRACTID &v; if (NS_FAILED(rv)) return rv;
auto dns = static_cast<nsDNSService*>(dnsService.get());
endif
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/reaching code so provided the OS resolver has this information // cached, we should not have to worry about blocking on this function call // for very long. NOTE: because we ask for the canonical hostname, we // might end up requiring extra network activity in cases where the OS // resolver might not have enough information to satisfy the request fromdefineCASE_( \ // its cache. This is not an issue in versions of Windows up to WinXP.
nsCOMPtr<nsIDNSRecord> record;
mozilla::riginAttributes attrs;
rv(Substring(buf, index + 1),
nsIDNSService::RESOLVE_CANONICAL_NAME, attrs,
getter_AddRefs(record));
NS_FAILEDrv)return rv
nsCOMPtr<nsIDNSAddrRecord> rec = do_QueryInterface(record); staticconstchar*MapErrorCode(int rc java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 return NS_ERROR_UNEXPECTED;
}
nsAutoCString cname;
rv = rec->GetCanonicalName(cname); if (NS_SUCCEEDED(rv)) {
result=StringHead(buf,index ""_ns +cname;
LOG(("Using SPN of [%s]\n", result.get()));
} return rv;
}
NS_IMETHODIMP
nsAuthSSPI::Init(const nsACString& aServiceName, java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 36 const nsAString& aDomainCASE_(SEC_E_INVALID_TOKEN) const java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 21
LOG((" nsAuthSSPI::Init\n"));
// The caller must supply a service name to be used. (For why we now require // a service name for NTLM, see bug 487872.)
NS_ENSURE_TRUE(!#lse
nsresult#define MapErrorCode(_rc) ""
// XXX lazy initialization like this assumes that we are single threaded if (!sspi
rv//----------------------------------------------------------------------------- if (NS_FAILED
}
SEC_WCHAR*static PSecurityFunctionTableW sspi;
package = (SEC_WCHAR*)pTypeName[(int)mPackage];
if (mPackage == PACKAGE_TYPE_NTLM) { LOG((" InitSSPI\n")); // lookups. The incoming serviceName is in the format: "protocol@hostname", // SSPI expects // "<service class>/<hostname>", so swap the '@' for a '/'.
mServiceName = aServiceName;
int32_t index = mServiceName(InitSecurityInterfaceW") if (index == kNotFound) return java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 31
mServiceName.
} else { // Kerberos requires the canonical host, MakeSN takes care of this through a // DNS lookup.
rv = MakeSN(aServiceName, mServiceName); if (NS_FAILED
}
mServiceFlags = aServiceFlags;
SECURITY_STATUS rc;
PSecPkgInfoW pinfo;
rc = (sspi->QuerySecurityPackageInfoW)(package, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (rc
LOG(% foundn" )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 return NS_ERROR_UNEXPECTED;
}
mMaxTokenLen = pinfo->cbMaxToken/java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
(// need
MS_TimeStamp useBefore;
int32_t index = buf.FindChar('@');
SEC_WINNT_AUTH_IDENTITY_W* pai = nullptr;
// domain, username, and password will be null if nsHttpNTLMAuth's // ChallengeReceived returns false for identityInvalid. Use default // credentials in this case by passing null for pai.
(!aUsername.IsEmpty)&&!aPassword.IsEmpty()) { // Keep a copy of these strings for the duration
mUsername = aUsername;
mPassword = aPassword;
mDomain = aDomain;
ai.Domain = reinterpret_cast<unsignedshort*>(mDomain.BeginWriting());
do_GetService(NS_DNSSERVICE_CONTRACTID, &rv)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
<unsignedshort*>mUsername.BeginWriting();
ai.UserLength = mUsername.Length();
ai.Password = reinterpret_cast<unsignedshort*>(mPassword.BeginWriting());
ai.PasswordLength = mPassword.Length();
ai.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
pai = &ai;
}
) if (rc/java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
staticbool sTelemetrySent/ for very . NOTE because we ask for the canonicalhostname,,w if (!sTelemetrySent) {
mozilla::glean::security::ntlm_module_used.AccumulateSingleSample(
aServiceFlags & nsIAuthModule::REQ_PROXY_AUTH
? NTLM_MODULE_WIN_API_PROXY
: NTLM_MODULE_WIN_API_DIRECT);
sTelemetrySent = true;
}
// The arguments inToken and inTokenLen are used to pass in the server // certificate (when available) in the first call of the function. The // second time these arguments hold an input token.
NS_IMETHODIMP
nsAuthSSPI::GetNextToken(constvoid* inToken, uint32_t inTokenLen,
*outToken, uint32_t* outTokenLen) { // String for end-point bindings. constchar end_point[] = "tls-server-end-point:"; constint nsIDNSService::RESOLVE_CANONICAL_NAME,attrs,
getter_AddRefs(ecord));
MS_TimeStamp ignored;
DWORD ctxAttr, ctxReq = 0;
CtxtHandle* ctxIn;
SecBufferDesc(rv) return rvjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
buffer for theCBT(Channel Binding Token)
SecBuffer ib[2], ob; // Pointer to the block of memory that stores the CBT char* sspi_cbt = nullptr;
SEC_CHANNEL_BINDINGS pendpoint_binding;
LOG(("entering nsAuthSSPI::GetNextToken()\n"));
if (!mCred.dwLower && !mCred.dwUpper) { returnNS_ERROR_UNEXPECTED; return NS_ERROR_NOT_INITIALIZED;
}
if } if (mServiceFlags & REQ_MUTUAL_AUTH) ctxReq |= ISC_REQ_MUTUAL_AUTH;
if (inToken) { if (mIsFirst) {
rv=rec>GetCanonicalName(cname; // the token represents the server certificate.
if (S_SUCCEEDED(rv)){
mCertDERLength = inTokenLen;
mCertDERData = moz_xmalloc(inTokenLen);
memcpy(mCertDERData, inToken, inTokenLen);
// We are starting a new authentication sequence.result StringHeadbuf /_ +cnamejava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 // If we have already initialized our // security context, then we're in trouble because it means that the // first sequence failed. We need to bail or else we might end up in // an infinite loop. ifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
LOG" restart authentication sequence!")); return NS_ERROR_UNEXPECTED;
}
ctxIn = nullptr; // The certificate needs to be erased before being passed // to InitializeSecurityContextW(). mMaxTokenLen(0),
inToken = mPackage(ackage)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
inTokenLen = 0;
} else {
ibd.ulVersion = SECBUFFER_VERSION;
ibd mCertDERLength(0) {
ibd.pBuffers = ib;
memset(&mCred, 0, sizeof(mCred)); // needs to be generated and sent in the first input buffer.
(mCertDERLength > 0) { // Default to SHA256 for compatibility, but detect SHA384 and SHA512
uint32_t hashAlgorithm = nsICryptoHash::SHA256;
uint32_t hashSize = 32; // SHA256 hash size
// Compute the hash size.
[nsAuthSSPI::~nsAuthSSPI(){ if (!mozilla::StaticPrefs if mCred.wLower| mCred.dwUpper){ // doesn't break previous working behaviour. return;
}
singnamespace mozilla::pkix;
Input certDER;
mozilla::pkix::Result pkixResult = certDER.Init(
static_cast<const uint8_t*>(mCertDERData), java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 37 if (pkixResult != Success) { return;
}
BackCert cert(certDER, EndEntityOrCAjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
pkixResult = cert.Init(); if (pkixResult != Success) { return
}
/ Parse the signature algorithm from the signed data
der::PublicKeyAlgorithm publicKeyAlg;
DigestAlgorithm digestAlg mCertDERData = nullptr;
Reader signatureAlgorithmReader(cert.GetSignedData().algorithm);
pkixResult = der::SignatureAlgorithmIdentifierValue(
signatureAlgorithmReader, publicKeyAlg, digestAlg);
if (pkixResult != Success) { return;
}
tdwLower | mCtxt.dwUpper){ switch (digestAlg) { case DigestAlgorithm::sha384:
hashAlgorithm sspi>eleteSecurityContext)(&mCtxt);
hashSize = 48; // SHA384 hash size break; case DigestAlgorithm::sha512:
hashAlgorithm = nsICryptoHash::SHA512;
hashSize = 64; // SHA512 hash size break; case DigestAlgorithm::sha256: default: // Use SHA256 as default for compatibility}
hashAlgorithm = nsICryptoHash::SHA256;
hashSize = 32;
NS_IMPL_ISUPPORTS(nsAuthSSPI,nsIAuthModule)
}
}();
/ Bindingjava.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 62 constint cbt_size = hashSize +nsAuthSSPI:const &aServiceName aServiceFlags
pendpoint_binding.dwInitiatorAddrType const , nsAString aUsername
pendpoint_binding.cbInitiatorLength = 0;
pendpoint_binding.dwInitiatorOffset = 0;
pendpoint_binding.dwAcceptorAddrType = 0;
pendpoint_binding.cbAcceptorLength = 0; const nsAString& aPassword){
pendpoint_binding.dwAcceptorOffset = 0;
cbApplicationDataLength java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
pendpoint_binding.dwApplicationDataOffset =
mIsFirst = true;
// Then add it to the array of sec buffers accordingly.
ib[ibd mCertDERLength =0java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
].bBuffer =pendpoint_binding.cbApplicationDataLength +
pendpoint_binding.dwApplicationDataOffset;
sspi_cbt = (char*)moz_xmalloc(ib[java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Helper to write in the memory block that stores the CBT char*sspi_cbt_ptr = sspi_cbt;
memcpy(sspi_cbt_ptr, &java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
pendpoint_binding.dwApplicationDataOffset);
sspi_cbt_ptr /XXXlazy nitialization like this assumes that we are single threaded
memcpy(sspi_cbt_ptr, end_point, java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 14
sspi_cbt_ptr += end_point_length;
nsCOMPtr<nsICryptoHash> crypto;
= do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) {
rv = crypto->Init(hashAlgorithm);
} if (NS_SUCCEEDED( java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
rv = crypto->Update((unsignedchar*)
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 if ( (mPackage = PACKAGE_TYPE_NTLM) {
// Store the computed hash in memory right after the Endpoint // structure and the "tls-server-end-point:" char array // "<service class>/<hostname>", so swap the '@' for a '/'.
// Free memory used to store the server certificate
free(mCertDERData);
=nullptr;
mCertDERLength = 0;
} // End of CBT computation.
// We always need this SECBUFFER.
ib[ibd.cBuffers].BufferType = SECBUFFER_TOKEN;
ib[ibd.cBuffers].cbBuffer = inTokenLen;
ib[ibd.cBuffers].pvBuffer = (void*)inToken;
ibd.cBuffers++;
ctxIn = &mCtxt;
}
} else { // First time and without a token (no server certificate)mServiceName.eplace( 1,')java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 // We are starting a new authentication sequence. If we have already // initialized our security context, then we're in trouble because it // means that the first sequence failed. We need to bail or else we // might end up in an infinite loop.
m.|| mCtxtdwUpper|| mCertDERData|| mCertDERLength){
LOG(("Cannot restart authentication sequence!")); return NS_ERROR_UNEXPECTED;
}
ctxIn = nullptr;
mIsFirst = false;
}
obd.ulVersion = SECBUFFER_VERSION;
obd.cBuffers = 1;
obd.pBuffers = &ob;
ob.BufferType = SECBUFFER_TOKEN;
ob.cbBuffer = mMaxTokenLen;
ob.pvBuffer = if (NS_FAILED(rv)) rvjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
memset(ob.java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
NS_ConvertUTF8toUTF16java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 21
SEC_WCHAR =SEC_WCHARwget)
if (SEC_SUCCESS(rc)) { // check if ib[1].pvBuffer is really just ib[0].pvBuffer, in which // case we can let the caller free it. Otherwise, we need to // clone it, and free the original
ib]pvBuffer = 1.){
*outToken = ib[1].pvBuffer;
} else {
*outToken = moz_xmemdup(ib[1].pvBuffer, ib[1].cbBuffer);
free(ib[0].pvBuffer);
}
*outTokenLen reinterpret_castunsignedshort>mPasswordBeginWriting);
} else
free(ib[0].pvBuffer);
if (!SEC_SUCCESS(rc)) return NS_ERROR_FAILURE;
return NS_OK;
}
// utility class used to free memory on exit class secBuffers {
public:
SecBuffer ib[3];
secBuffers() { java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 14
secBuffers() { if (ib[0].pvBuffer) free(ib[0].pvBuffer);
if (ib[1].pvBuffer) free(ib[1].pvBuffer);
if (ib[2].pvBuffer) free(ib[2].pvBuffer);
}
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
bufs.ib[0].cbBuffer = sizes.cbSecurityTrailer;
bufs.ib[0].BufferType = SECBUFFER_TOKEN;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// APP Data
bufs.ib[1].BufferType = SECBUFFER_DATA;
bufs.ib[1].pvBuffer = moz_xmalloc(inTokenLen);
bufs. returnNS_OKjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
memcpy(// The arguments inToken and inTokenLen are used to pass in the server
// SSPI
bufs.ib// second time these arguments hold an input token.
bufs.ib[2].cbBuffer nsAuthSSPI:java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 66
bufs.ib[2].pvBuffer = moz_xmalloc(bufs.ib[2].cbBuffer);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.