extensions/auth/nsAuthSSPI.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/extensions/auth/nsAuthSSPI.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +/* vim:set ts=4 sw=4 et cindent: */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsAuthSSPI_h__
    1.10 +#define nsAuthSSPI_h__
    1.11 +
    1.12 +#include "nsAuth.h"
    1.13 +#include "nsIAuthModule.h"
    1.14 +#include "nsString.h"
    1.15 +
    1.16 +#include <windows.h>
    1.17 +
    1.18 +#define SECURITY_WIN32 1
    1.19 +#include <ntsecapi.h>
    1.20 +#include <security.h>
    1.21 +#include <rpc.h>
    1.22 +
    1.23 +// The nsNegotiateAuth class provides responses for the GSS-API Negotiate method
    1.24 +// as specified by Microsoft in draft-brezak-spnego-http-04.txt
    1.25 +
    1.26 +// It can also be configured to talk raw NTLM.  This implementation of NTLM has
    1.27 +// the advantage of being able to access the user's logon credentials.  This
    1.28 +// implementation of NTLM should only be used for single-signon.  It should be
    1.29 +// avoided when authenticating over the internet since it may use a lower-grade
    1.30 +// version of password hashing depending on the version of Windows being used.
    1.31 +
    1.32 +class nsAuthSSPI MOZ_FINAL : public nsIAuthModule
    1.33 +{
    1.34 +public:
    1.35 +    NS_DECL_ISUPPORTS
    1.36 +    NS_DECL_NSIAUTHMODULE
    1.37 +
    1.38 +    nsAuthSSPI(pType package = PACKAGE_TYPE_NEGOTIATE);
    1.39 +
    1.40 +private:
    1.41 +    ~nsAuthSSPI();
    1.42 +
    1.43 +    void Reset();
    1.44 +
    1.45 +    typedef TimeStamp MS_TimeStamp;
    1.46 +
    1.47 +private:
    1.48 +    CredHandle   mCred;
    1.49 +    CtxtHandle   mCtxt;
    1.50 +    nsCString    mServiceName;
    1.51 +    uint32_t     mServiceFlags;
    1.52 +    uint32_t     mMaxTokenLen;
    1.53 +    pType        mPackage;
    1.54 +    nsString     mDomain;
    1.55 +    nsString     mUsername;
    1.56 +    nsString     mPassword;
    1.57 +    bool         mIsFirst;	
    1.58 +    void*        mCertDERData; 
    1.59 +    uint32_t     mCertDERLength;
    1.60 +};
    1.61 +
    1.62 +#endif /* nsAuthSSPI_h__ */

mercurial