- ultimatetcp-ip42_samples.zip
- Ultimate TCP-IP
- ActiveX
- BuildAll
- MinDependency_Dlls
- MinDependency_EvalDlls
- UTDns
- UTFinger
- UTFingerServ
- utftp
- utftpserv
- UTHistory
- uthttp
- UTImap4
- UTMail
- UTMailServ
- UTMsg
- UTNntp
- utping
- UTSocket
- Demos
- Examples
- Client
- ASP
- MFC
- Imap4
- Nntp
- SDK
- DNS
- Finger
- Ftp
- History
- Http
- Mail
- MX Lookup
- Ping
- UDP
- VisualBasic
- Dns
- Finger
- Ftp
- History
- Http
- Imap4
- Mail
- MartsMail
- Nntp
- Ping
- Socket
- UDPSocket
- Master.dsw
- Master.sln
- Server
- ASP
- MFC
- SampleServer
- SDK
- AccessControlServerDemo
- Finger
- Ftp
- Http
- Mail
- VisualBasic
- service
- svrtest
- Security
- Examples
- Client
- Echo
- FTPs
- Https
- Imap4s
- Mail
- MasterS.dsw
- MasterS.sln
- Server
- Echo
- FTPs
- Https
- Mail
- Test_Del
- Util
- CertManager
- ultimatetcp-ip42_docs.zip
- ultimatetcp-ip42_src.zip
- Include
|
/* =================================================================
// class: CUT_CramMd5
// File: UT_CramMd5.h
//
// Purpose:
//
// Challenge-Response Authentication Mechanism
//
// ===================================================================
// Ultimate TCP/IP v4.2
// This software along with its related components, documentation and files ("The Libraries")
// is � 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
// governed by a software license agreement ("Agreement"). Copies of the Agreement are
// available at The Code Project (www.codeproject.com), as part of the package you downloaded
// to obtain this file, or directly from our office. For a copy of the license governing
// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
//
// =================================================================*/
#ifndef EA3A1804_7185_11d5_AA0F_0050BAAAE90D
#define EA3A1804_7185_11d5_AA0F_0050BAAAE90D
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include "Base64.h"
#include "md5.h"
#include <assert.h>
// Challenge-Response Authentication Mechanism
class CUT_CramMd5{
protected :
// hold the user password
char *m_szPassword;
// holds the user name
char *m_szUserName;
// internal buffer to hold the result
char *m_ChallengeResponse;
public:
// constructor
CUT_CramMd5();
// destructor
~CUT_CramMd5();
// HMAC MD5 Function
void HmacMd5( unsigned char* , // pointer to data stream
int , //length of data stream
unsigned char* , //pointer to authentication key
int , //length of authentication key
MD5 & // refrence to the context that receives the result digest
);
// set the user name
void SetUserName(LPCSTR name);
// set the user password
void SetPassword(LPCSTR pass);
// retrive the user name
const char * GetUserName();
//retrieve the user password
const char *GetPassword();
// get the MD5 Maced response for the challenge specified
char *GetClientResponse(LPCSTR ServerChallenge);
};
#endif //EA3A1804_7185_11d5_AA0F_0050BAAAE90D
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.
Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.