mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1344081 - Switch to Base64Decode in nsHttpNegotiateAuth::GenerateCredentials. r=jduell
MozReview-Commit-ID: 4A5tEV5Fb8
This commit is contained in:
parent
875087211f
commit
fab046bdc7
@ -32,6 +32,7 @@
|
||||
#include "nsNetCID.h"
|
||||
#include "plbase64.h"
|
||||
#include "plstr.h"
|
||||
#include "mozilla/Base64.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/Tokenizer.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
@ -49,6 +50,8 @@
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/net/HttpAuthUtils.h"
|
||||
|
||||
using mozilla::Base64Decode;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static const char kNegotiate[] = "Negotiate";
|
||||
@ -535,17 +538,14 @@ nsHttpNegotiateAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChanne
|
||||
while (challenge[len - 1] == '=')
|
||||
len--;
|
||||
|
||||
inTokenLen = (len * 3)/4;
|
||||
inToken = malloc(inTokenLen);
|
||||
if (!inToken)
|
||||
return (NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
//
|
||||
// Decode the response that followed the "Negotiate" token
|
||||
//
|
||||
if (PL_Base64Decode(challenge, len, (char *) inToken) == nullptr) {
|
||||
free(inToken);
|
||||
return(NS_ERROR_UNEXPECTED);
|
||||
nsresult rv =
|
||||
Base64Decode(challenge, len, (char**)&inToken, &inTokenLen);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user