Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: net/http/http_auth_handler_ntlm.h

Issue 42052: Add unit tests for NTLM authentication. This requires... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Upload before checkin Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_auth_handler_ntlm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_ntlm.h
===================================================================
--- net/http/http_auth_handler_ntlm.h (revision 11487)
+++ net/http/http_auth_handler_ntlm.h (working copy)
@@ -7,6 +7,7 @@
#include <string>
+#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "net/http/http_auth_handler.h"
@@ -17,6 +18,15 @@
// Code for handling HTTP NTLM authentication.
class HttpAuthHandlerNTLM : public HttpAuthHandler {
public:
+ // A function that generates n random bytes in the output buffer.
+ typedef void (*GenerateRandomProc)(uint8* output, size_t n);
+
+ // A function that returns the local host name as a null-terminated string
+ // in the output buffer. Returns an empty string if the local host name is
+ // not available.
+ // TODO(wtc): return a std::string instead.
+ typedef void (*HostNameProc)(char* name, size_t namelen);
+
HttpAuthHandlerNTLM();
virtual ~HttpAuthHandlerNTLM();
@@ -28,6 +38,10 @@
const HttpRequestInfo* request,
const ProxyInfo* proxy);
+ // For unit tests to override the GenerateRandom and GetHostName functions.
+ static void SetGenerateRandomProc(GenerateRandomProc proc);
+ static void SetHostNameProc(HostNameProc proc);
+
protected:
virtual bool Init(std::string::const_iterator challenge_begin,
std::string::const_iterator challenge_end) {
« no previous file with comments | « no previous file | net/http/http_auth_handler_ntlm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698