Permalink
Browse files

Added SCRAM stubs

  • Loading branch information...
1 parent eb07c0b commit 84163fdcbd4ddcac7c72388cc02cab51e733f322 unknown committed Jan 26, 2010
@@ -167,7 +167,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
EnableFiberSafeOptimizations="true"
- AdditionalIncludeDirectories="$(IntDir);../kfw-3.2.2-final/inc/krb5/"
+ AdditionalIncludeDirectories="$(IntDir)"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_MT;i386"
StringPooling="true"
ExceptionHandling="1"
@@ -466,6 +466,14 @@
>
</File>
<File
+ RelativePath=".\SCRAM.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\SCRAM.h"
+ >
+ </File>
+ <File
RelativePath=".\SSPI.cpp"
>
</File>
@@ -443,17 +443,25 @@ library PandionLib
[in] BSTR nc,
[in] BSTR qop,
[out,retval] BSTR* strDigest);
+ [propget] HRESULT SCRAM([out, retval] VARIANT* pDispatch);
[propget] HRESULT SSPI([out, retval] VARIANT* pDispatch);
[propget] HRESULT GSSAPI([out, retval] VARIANT* pDispatch);
}
+ [uuid(D589A536-0A43-11DF-97E6-DDC756D89593)]
+ interface ISCRAM : IDispatch
+ {
+ HRESULT GenerateResponse(
+ [in] BSTR Challenge,
+ [out, retval] BSTR* Response);
+ }
[uuid(D4C00020-E57A-434e-9289-937C53CC07ED)]
interface ISSPI : IDispatch
{
HRESULT Reset();
HRESULT GenerateResponse(
[in] BSTR Challenge,
[out] BOOL* Continue,
- [out,retval] BSTR* Response);
+ [out, retval] BSTR* Response);
}
[uuid(5FA5AC97-F9E0-4ea0-A1BD-2957A331FF47)]
interface IGSSAPI : IDispatch
@@ -462,7 +470,7 @@ library PandionLib
HRESULT GenerateResponse(
[in] BSTR ServerName,
[in] BSTR Challenge,
- [out,retval] BSTR* Response);
+ [out, retval] BSTR* Response);
}
[uuid(3AA4A7CE-829F-4b24-BB86-D96A23084F51)]
interface IShortcut : IDispatch
@@ -107,6 +107,11 @@ STDMETHODIMP SASL::DigestGenerateResponse(BSTR username, BSTR realm,
return S_OK;
}
+STDMETHODIMP SASL::get_SCRAM(VARIANT* pDispatch)
+{
+ pDispatch->vt = VT_DISPATCH;
+ return m_SCRAM.QueryInterface(IID_IDispatch, (void**)&pDispatch->pdispVal);
+}
STDMETHODIMP SASL::get_SSPI(VARIANT* pDispatch)
{
pDispatch->vt = VT_DISPATCH;
View
@@ -21,13 +21,15 @@
*/
#pragma once
#include "DispInterfaceImpl.h"
+#include "SCRAM.h"
#include "SSPI.h"
#include "GSSAPI.h"
class SASL :
public DispInterfaceImpl<ISASL>
{
private:
+ SCRAM m_SCRAM;
SSPI m_SSPI;
GSSAPI m_GSSAPI;
public:
@@ -39,6 +41,7 @@ class SASL :
STDMETHOD(DigestGenerateResponse)(
BSTR username, BSTR realm, BSTR password, BSTR nonce,
BSTR cnonce, BSTR digest_uri, BSTR nc, BSTR qop, BSTR *strDigest);
+ STDMETHOD(get_SCRAM)(VARIANT* pDispatch);
STDMETHOD(get_SSPI)(VARIANT* pDispatch);
STDMETHOD(get_GSSAPI)(VARIANT* pDispatch);
View
@@ -0,0 +1,53 @@
+/**
+ * This file is part of Pandion.
+ *
+ * Pandion is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Pandion is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pandion. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Filename: SCRAM.cpp
+ * Author(s): Dries Staelens
+ * Copyright: Copyright (c) 2009 Dries Staelens
+ * Description: This file implements some helper methods for authenticating
+ * using the Salted Challenge Response (SCRAM) SASL mechanism.
+ * See http://tools.ietf.org/html/draft-ietf-sasl-scram-10
+ */
+#include "stdafx.h"
+#include "SCRAM.h"
+#include "Base64.h"
+#include "UTF8.h"
+
+SCRAM::SCRAM()
+{
+}
+SCRAM::~SCRAM()
+{
+}
+STDMETHODIMP SCRAM::GenerateResponse(BSTR Challenge, BSTR *Response)
+{
+ return E_NOTIMPL;
+}
+void SCRAM::Error(LPWSTR Where, LPWSTR WhenCalling, DWORD ErrorCode)
+{
+ LPTSTR ErrorMessage;
+ ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
+ NULL, ErrorCode, 0, (LPTSTR)&ErrorMessage, 0, NULL);
+ std::wostringstream dbgMsg;
+ dbgMsg << L"SCRAM error in " << Where <<
+ L" when calling " << WhenCalling <<
+ std::hex << std::setw(8) << std::setfill(L'0') <<
+ L": (ERROR 0x" << ErrorCode << L") " <<
+ ErrorMessage << std::endl;
+ OutputDebugString(dbgMsg.str().c_str());
+ ::LocalFree(ErrorMessage);
+}
View
@@ -0,0 +1,38 @@
+/**
+ * This file is part of Pandion.
+ *
+ * Pandion is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Pandion is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pandion. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Filename: SCRAM.h
+ * Author(s): Dries Staelens
+ * Copyright: Copyright (c) 2010 Dries Staelens
+ * Description: This header defines some helper methods for authenticating
+ * using the Salted Challenge Response (SCRAM) SASL mechanism.
+ * See http://tools.ietf.org/html/draft-ietf-sasl-scram-10
+ */
+
+#pragma once
+#include "DispInterfaceImpl.h"
+
+class SCRAM :
+ public DispInterfaceImpl<ISCRAM>
+{
+public:
+ SCRAM();
+ ~SCRAM();
+
+ STDMETHOD(GenerateResponse)(BSTR Challenge, BSTR *Response);
+private:
+ void Error(LPWSTR Where, LPWSTR WhenCalling, DWORD ErrorCode);
+};
Binary file not shown.
Binary file not shown.
@@ -1,60 +0,0 @@
-LIBRARY
-; zlib data compression library
-
-EXPORTS
-; basic functions
- zlibVersion
- deflate
- deflateEnd
- inflate
- inflateEnd
-; advanced functions
- deflateSetDictionary
- deflateCopy
- deflateReset
- deflateParams
- deflateBound
- deflatePrime
- inflateSetDictionary
- inflateSync
- inflateCopy
- inflateReset
- inflateBack
- inflateBackEnd
- zlibCompileFlags
-; utility functions
- compress
- compress2
- compressBound
- uncompress
- gzopen
- gzdopen
- gzsetparams
- gzread
- gzwrite
- gzprintf
- gzputs
- gzgets
- gzputc
- gzgetc
- gzungetc
- gzflush
- gzseek
- gzrewind
- gztell
- gzeof
- gzclose
- gzerror
- gzclearerr
-; checksum functions
- adler32
- crc32
-; various hacks, don't look :)
- deflateInit_
- deflateInit2_
- inflateInit_
- inflateInit2_
- inflateBackInit_
- inflateSyncPoint
- get_crc_table
- zError
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 84163fd

Please sign in to comment.