s/qmail 4.3.17
Next generation secure email transport
Loading...
Searching...
No Matches
dkimbase.h
Go to the documentation of this file.
1/*****************************************************************************
2* Copyright 2005 Alt-N Technologies, Ltd.
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* This code incorporates intellectual property owned by Yahoo! and licensed
11* pursuant to the Yahoo! DomainKeys Patent License Agreement.
12*
13* Unless required by applicable law or agreed to in writing, software
14* distributed under the License is distributed on an "AS IS" BASIS,
15* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16* See the License for the specific language governing permissions and
17* limitations under the License.
18*
19* Changes done by ¢feh@fehcom.de obeying the above license
20*
21*****************************************************************************/
22#ifndef DKIMBASE_H
23#define DKIMBASE_H
24
25#include <openssl/evp.h>
26#include <openssl/pem.h>
27#include <openssl/err.h>
28
29#define BUFFER_ALLOC_INCREMENT 256
30
31#include <string>
32#include <list>
33
34using namespace std;
35
37{
38public:
39
40 CDKIMBase();
41 ~CDKIMBase();
42
43 int Init(void);
44
45 int Process(const char* szBuffer,int nBufLength,bool bEOF);
46 int ProcessFinal(void);
47
48 int Alloc(char*& szBuffer,int nRequiredSize);
49 int ReAlloc(char*& szBuffer,int& nBufferLength,int nRequiredSize);
50 void Free(char* szBuffer);
51
52 static void RemoveSWSP(char* szBuffer);
53 static void RemoveSWSP(char* pBuffer,int& nBufLength);
54 static void RemoveSWSP(string& sBuffer);
55
56 static void CompressSWSP(char* pBuffer,int& nBufLength);
57 static void CompressSWSP(string& sBuffer);
58
59 static string RelaxHeader(const string& sHeader);
60
61 virtual int ProcessHeaders(void);
62 virtual int ProcessBody(char* szBuffer,int nBufLength,bool bEOF);
63
64protected:
65 char* m_From;
66 char* m_Sender;
67 char* m_hTag;
70 char* m_Line;
74
75 list<string> HeaderList;
76};
77
78
79#endif // DKIMBASE_H
int m_LineSize
Definition: dkimbase.h:71
int ReAlloc(char *&szBuffer, int &nBufferLength, int nRequiredSize)
Definition: dkimbase.cpp:71
static string RelaxHeader(const string &sHeader)
Definition: dkimbase.cpp:293
int m_LinePos
Definition: dkimbase.h:72
int ProcessFinal(void)
Definition: dkimbase.cpp:167
int m_hTagSize
Definition: dkimbase.h:68
static void CompressSWSP(char *pBuffer, int &nBufLength)
Definition: dkimbase.cpp:235
bool m_InHeaders
Definition: dkimbase.h:73
static void RemoveSWSP(char *szBuffer)
Definition: dkimbase.cpp:214
int Init(void)
Definition: dkimbase.cpp:49
char * m_Line
Definition: dkimbase.h:70
list< string > HeaderList
Definition: dkimbase.h:75
~CDKIMBase()
Definition: dkimbase.cpp:41
char * m_From
Definition: dkimbase.h:65
int m_hTagPos
Definition: dkimbase.h:69
int Alloc(char *&szBuffer, int nRequiredSize)
Definition: dkimbase.cpp:59
virtual int ProcessHeaders(void)
Definition: dkimbase.cpp:188
virtual int ProcessBody(char *szBuffer, int nBufLength, bool bEOF)
Definition: dkimbase.cpp:198
char * m_hTag
Definition: dkimbase.h:67
void Free(char *szBuffer)
Definition: dkimbase.cpp:97
int Process(const char *szBuffer, int nBufLength, bool bEOF)
Definition: dkimbase.cpp:108
char * m_Sender
Definition: dkimbase.h:66