/* vim:set ts=4 sw=2 et cindent: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
if (!mInnerModule) return NS_ERROR_NOT_INITIALIZED;
if (mSASLReady) { // If the server COMPLETEs with an empty token, Cyrus sends us that token. // I don't think this is correct, but we need to handle that behaviour. // Cyrus ignores the contents of our reply token. if (inTokenLen == 0) {
*outToken = nullptr;
*outTokenLen = 0; return NS_OK;
} // We've completed the GSSAPI portion of the handshake, and are // now ready to do the SASL security layer and authzid negotiation
// Input packet from the server needs to be unwrapped.
rv = mInnerModule->Unwrap(inToken, inTokenLen, &unwrappedToken,
&unwrappedTokenLen); if (NS_FAILED(rv)) {
Reset(); return rv;
}
// If we were doing security layers then we'd care what the // server had sent us. We're not, so all we had to do was make // sure that the signature was correct with the above unwrap()
free(unwrappedToken);
NS_CopyUnicodeToNative(mUsername, userbuf);
messageLen = userbuf.Length() + 4 + 1;
message = (char*)moz_xmalloc(messageLen);
message[0] = 0x01; // No security layer
message[1] = 0x00;
message[2] = 0x00;
message[3] = 0x00; // Maxbuf must be zero if we've got no sec layer
strcpy(message + 4, userbuf.get()); // Userbuf should not be nullptr terminated, so trim the trailing nullptr // when wrapping the message
rv = mInnerModule->Wrap((void*)message, messageLen - 1, false, outToken,
outTokenLen);
free(message);
Reset(); // All done return NS_SUCCEEDED(rv) ? NS_SUCCESS_AUTH_FINISHED : rv;
}
rv = mInnerModule->GetNextToken(inToken, inTokenLen, outToken, outTokenLen); if (rv == NS_SUCCESS_AUTH_FINISHED) {
mSASLReady = true;
rv = NS_OK;
} return rv;
}
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 ist noch experimentell.