Bug 1858509 add thread-safety annotations around MediaSourceDemuxer::mMonitor r=alwu
[gecko.git] / extensions / auth / nsAuthSSPI.h
blob96ad6b1cb903c1cfad7eceb002948f444a14bbec
1 /* vim:set ts=4 sw=2 et cindent: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsAuthSSPI_h__
7 #define nsAuthSSPI_h__
9 #include "nsAuth.h"
10 #include "nsIAuthModule.h"
11 #include "nsString.h"
13 #include <windows.h>
15 #define SECURITY_WIN32 1
16 #include <ntsecapi.h>
17 #include <security.h>
18 #include <rpc.h>
20 // The nsNegotiateAuth class provides responses for the GSS-API Negotiate method
21 // as specified by Microsoft in draft-brezak-spnego-http-04.txt
23 // It can also be configured to talk raw NTLM. This implementation of NTLM has
24 // the advantage of being able to access the user's logon credentials. This
25 // implementation of NTLM should only be used for single-signon. It should be
26 // avoided when authenticating over the internet since it may use a lower-grade
27 // version of password hashing depending on the version of Windows being used.
29 class nsAuthSSPI final : public nsIAuthModule {
30 public:
31 NS_DECL_ISUPPORTS
32 NS_DECL_NSIAUTHMODULE
34 explicit nsAuthSSPI(pType package = PACKAGE_TYPE_NEGOTIATE);
36 private:
37 ~nsAuthSSPI();
39 void Reset();
41 typedef ::TimeStamp MS_TimeStamp;
43 private:
44 nsresult MakeSN(const nsACString& principal, nsCString& result);
46 CredHandle mCred;
47 CtxtHandle mCtxt;
48 nsCString mServiceName;
49 uint32_t mServiceFlags;
50 uint32_t mMaxTokenLen;
51 pType mPackage;
52 nsString mDomain;
53 nsString mUsername;
54 nsString mPassword;
55 bool mIsFirst;
56 void* mCertDERData;
57 uint32_t mCertDERLength;
60 #endif /* nsAuthSSPI_h__ */