s/qmail 4.3.17
Next generation secure email transport
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
CDKIMSign Class Reference

#include <dkimsign.h>

Public Types

enum  CKDKIMConstants { OptimalHeaderLineLength = 65 }
 

Public Member Functions

 CDKIMSign ()
 
 ~CDKIMSign ()
 
int Init (DKIMSignOptions *pOptions)
 
int GetSig2 (char *szRSAPrivKey, char *szECCPrivKey, char **pszSignature)
 
virtual int ProcessHeaders (void) override
 
virtual int ProcessBody (char *szBuffer, int nBufLength, bool bEOF) override
 
void Hash (const char *szBuffer, int nBufLength, bool bHdr)
 
- Public Member Functions inherited from CDKIMBase
 CDKIMBase ()
 
 ~CDKIMBase ()
 
int Init (void)
 
int Process (const char *szBuffer, int nBufLength, bool bEOF)
 
int ProcessFinal (void)
 
int Alloc (char *&szBuffer, int nRequiredSize)
 
int ReAlloc (char *&szBuffer, int &nBufferLength, int nRequiredSize)
 
void Free (char *szBuffer)
 
virtual int ProcessHeaders (void)
 
virtual int ProcessBody (char *szBuffer, int nBufLength, bool bEOF)
 

Protected Member Functions

bool SignThisTag (const string &sTag)
 
void GetHeaderParams (const string &sHdr)
 
void ProcessHeader (const string &sHdr)
 
bool ParseFromAddress (void)
 
void InitSig (void)
 
void AddTagToSig (const char *const Tag, const string &sValue, char cbrk, bool bFold)
 
void AddTagToSig (const char *const Tag, unsigned long nValue)
 
void AddInterTagSpace (int nSizeOfNextTag)
 
void AddFoldedValueToSig (const string &sValue, char cbrk)
 
bool IsRequiredHeader (const string &sTag)
 
int ConstructSignature (char *szSignKey, int nSigAlg)
 
int AssembleReturnedSig (char *szRSAPrivKey, char *szECCPrivKey)
 

Protected Attributes

EVP_MD_CTX * m_Hdr_sha1ctx
 
EVP_MD_CTX * m_Hdr_sha256ctx
 
EVP_MD_CTX * m_Hdr_ed25519ctx
 
EVP_MD_CTX * m_Bdy_sha1ctx
 
EVP_MD_CTX * m_Bdy_sha256ctx
 
EVP_MD_CTX * m_Edy_sha256ctx
 
int m_Canon
 
int m_EmptyLineCount
 
string hParam
 
string sFrom
 
string sSender
 
string sSelector
 
string eSelector
 
string sDomain
 
string sIdentity
 
string sRequiredHeaders
 
bool m_IncludeBodyLengthTag
 
int m_nBodyLength
 
time_t m_ExpireTime
 
int m_nIncludeTimeStamp
 
int m_nIncludeQueryMethod
 
int m_nHash
 
int m_nIncludeCopiedHeaders
 
DKIMHEADERCALLBACK m_pfnHdrCallback
 
string m_sSig
 
int m_nSigPos
 
string m_sReturnedSig
 
bool m_bReturnedSigAssembled
 
string m_sCopiedHeaders
 
string SigHdrs
 
int m_SigHdrs
 
- Protected Attributes inherited from CDKIMBase
char * m_From
 
char * m_Sender
 
char * m_hTag
 
int m_hTagSize
 
int m_hTagPos
 
char * m_Line
 
int m_LineSize
 
int m_LinePos
 
bool m_InHeaders
 
list< string > HeaderList
 

Additional Inherited Members

- Static Public Member Functions inherited from CDKIMBase
static void RemoveSWSP (char *szBuffer)
 
static void RemoveSWSP (char *pBuffer, int &nBufLength)
 
static void RemoveSWSP (string &sBuffer)
 
static void CompressSWSP (char *pBuffer, int &nBufLength)
 
static void CompressSWSP (string &sBuffer)
 
static string RelaxHeader (const string &sHeader)
 

Detailed Description

Definition at line 28 of file dkimsign.h.

Member Enumeration Documentation

◆ CKDKIMConstants

Enumerator
OptimalHeaderLineLength 

Definition at line 41 of file dkimsign.h.

Constructor & Destructor Documentation

◆ CDKIMSign()

CDKIMSign ( )

Definition at line 117 of file dkimsign.cpp.

◆ ~CDKIMSign()

~CDKIMSign ( )

Definition at line 140 of file dkimsign.cpp.

Member Function Documentation

◆ AddFoldedValueToSig()

void AddFoldedValueToSig ( const string &  sValue,
char  cbrk 
)
protected

Definition at line 621 of file dkimsign.cpp.

Here is the caller graph for this function:

◆ AddInterTagSpace()

void AddInterTagSpace ( int  nSizeOfNextTag)
protected

Definition at line 603 of file dkimsign.cpp.

Here is the caller graph for this function:

◆ AddTagToSig() [1/2]

void AddTagToSig ( const char *const  Tag,
const string &  sValue,
char  cbrk,
bool  bFold 
)
protected

Definition at line 566 of file dkimsign.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddTagToSig() [2/2]

void AddTagToSig ( const char *const  Tag,
unsigned long  nValue 
)
protected

Definition at line 591 of file dkimsign.cpp.

Here is the call graph for this function:

◆ AssembleReturnedSig()

int AssembleReturnedSig ( char *  szRSAPrivKey,
char *  szECCPrivKey 
)
protected

Definition at line 967 of file dkimsign.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConstructSignature()

int ConstructSignature ( char *  szSignKey,
int  nSigAlg 
)
protected

Definition at line 741 of file dkimsign.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHeaderParams()

void GetHeaderParams ( const string &  sHdr)
protected

Definition at line 306 of file dkimsign.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSig2()

int GetSig2 ( char *  szRSAPrivKey,
char *  szECCPrivKey,
char **  pszSignature 
)

Definition at line 681 of file dkimsign.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hash()

void Hash ( const char *  szBuffer,
int  nBufLength,
bool  bHdr 
)

START DEBUG CODE ** if (nBufLength == 2 && szBuffer[0] == '\r' && szBuffer[1] == '
') { printf("[CRLF]\n"); } else { char *szDbg = new char[nBufLength+1]; strncpy(szDbg,szBuffer,nBufLength); szDbg[nBufLength] = '\0'; printf("[%s]\n",szDbg); } ***

if (fpdebug == NULL) { fpdebug = fopen("canon.msg", "wb"); }

fwrite(szBuffer,1,nBufLength,fpdebug);

END DEBUG CODE

Definition at line 213 of file dkimsign.cpp.

Here is the caller graph for this function:

◆ Init()

int Init ( DKIMSignOptions pOptions)

Definition at line 155 of file dkimsign.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitSig()

void InitSig ( void  )
protected

Definition at line 553 of file dkimsign.cpp.

Here is the caller graph for this function:

◆ IsRequiredHeader()

bool IsRequiredHeader ( const string &  sTag)
protected

Definition at line 708 of file dkimsign.cpp.

Here is the caller graph for this function:

◆ ParseFromAddress()

bool ParseFromAddress ( void  )
protected

Definition at line 510 of file dkimsign.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessBody()

int ProcessBody ( char *  szBuffer,
int  nBufLength,
bool  bEOF 
)
overridevirtual

Reimplemented from CDKIMBase.

Definition at line 460 of file dkimsign.cpp.

Here is the call graph for this function:

◆ ProcessHeader()

void ProcessHeader ( const string &  sHdr)
protected

Definition at line 428 of file dkimsign.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessHeaders()

int ProcessHeaders ( void  )
overridevirtual

Reimplemented from CDKIMBase.

Definition at line 338 of file dkimsign.cpp.

Here is the call graph for this function:

◆ SignThisTag()

bool SignThisTag ( const string &  sTag)
protected

Definition at line 264 of file dkimsign.cpp.

Here is the caller graph for this function:

Field Documentation

◆ eSelector

string eSelector
protected

Definition at line 79 of file dkimsign.h.

◆ hParam

string hParam
protected

Definition at line 75 of file dkimsign.h.

◆ m_Bdy_sha1ctx

EVP_MD_CTX* m_Bdy_sha1ctx
protected

Definition at line 67 of file dkimsign.h.

◆ m_Bdy_sha256ctx

EVP_MD_CTX* m_Bdy_sha256ctx
protected

Definition at line 68 of file dkimsign.h.

◆ m_bReturnedSigAssembled

bool m_bReturnedSigAssembled
protected

Definition at line 98 of file dkimsign.h.

◆ m_Canon

int m_Canon
protected

Definition at line 71 of file dkimsign.h.

◆ m_Edy_sha256ctx

EVP_MD_CTX* m_Edy_sha256ctx
protected

Definition at line 69 of file dkimsign.h.

◆ m_EmptyLineCount

int m_EmptyLineCount
protected

Definition at line 73 of file dkimsign.h.

◆ m_ExpireTime

time_t m_ExpireTime
protected

Definition at line 86 of file dkimsign.h.

◆ m_Hdr_ed25519ctx

EVP_MD_CTX* m_Hdr_ed25519ctx
protected

Definition at line 65 of file dkimsign.h.

◆ m_Hdr_sha1ctx

EVP_MD_CTX* m_Hdr_sha1ctx
protected

Definition at line 63 of file dkimsign.h.

◆ m_Hdr_sha256ctx

EVP_MD_CTX* m_Hdr_sha256ctx
protected

Definition at line 64 of file dkimsign.h.

◆ m_IncludeBodyLengthTag

bool m_IncludeBodyLengthTag
protected

Definition at line 84 of file dkimsign.h.

◆ m_nBodyLength

int m_nBodyLength
protected

Definition at line 85 of file dkimsign.h.

◆ m_nHash

int m_nHash
protected

Definition at line 89 of file dkimsign.h.

◆ m_nIncludeCopiedHeaders

int m_nIncludeCopiedHeaders
protected

Definition at line 90 of file dkimsign.h.

◆ m_nIncludeQueryMethod

int m_nIncludeQueryMethod
protected

Definition at line 88 of file dkimsign.h.

◆ m_nIncludeTimeStamp

int m_nIncludeTimeStamp
protected

Definition at line 87 of file dkimsign.h.

◆ m_nSigPos

int m_nSigPos
protected

Definition at line 95 of file dkimsign.h.

◆ m_pfnHdrCallback

DKIMHEADERCALLBACK m_pfnHdrCallback
protected

Definition at line 92 of file dkimsign.h.

◆ m_sCopiedHeaders

string m_sCopiedHeaders
protected

Definition at line 100 of file dkimsign.h.

◆ m_SigHdrs

int m_SigHdrs
protected

Definition at line 103 of file dkimsign.h.

◆ m_sReturnedSig

string m_sReturnedSig
protected

Definition at line 97 of file dkimsign.h.

◆ m_sSig

string m_sSig
protected

Definition at line 94 of file dkimsign.h.

◆ sDomain

string sDomain
protected

Definition at line 80 of file dkimsign.h.

◆ sFrom

string sFrom
protected

Definition at line 76 of file dkimsign.h.

◆ sIdentity

string sIdentity
protected

Definition at line 81 of file dkimsign.h.

◆ SigHdrs

string SigHdrs
protected

Definition at line 102 of file dkimsign.h.

◆ sRequiredHeaders

string sRequiredHeaders
protected

Definition at line 82 of file dkimsign.h.

◆ sSelector

string sSelector
protected

Definition at line 78 of file dkimsign.h.

◆ sSender

string sSender
protected

Definition at line 77 of file dkimsign.h.


The documentation for this class was generated from the following files: