diff options
Diffstat (limited to 'src/dkim.cpp')
-rw-r--r-- | src/dkim.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/dkim.cpp b/src/dkim.cpp index 1ce8eee..8f07519 100644 --- a/src/dkim.cpp +++ b/src/dkim.cpp @@ -26,7 +26,9 @@ #include "dkimsign.h" #include "dkimverify.h" + #define DKIMID ('D' | 'K' << 8 | 'I' << 16 | 'M' << 24) + /* taken from removed file "ressource.h" */ #ifdef VERSION #define VERSION_STRING VERSION @@ -34,6 +36,7 @@ #define VERSION_STRING "1.4.0" #endif + static void InitContext(DKIMContext *pContext, bool bSign, void *pObject) { pContext->reserved1 = DKIMID; @@ -61,9 +64,7 @@ int DKIM_CALL DKIMSignInit(DKIMContext *pSignContext, DKIMSignOptions *pOptions) if (nRet != DKIM_SUCCESS) delete pSign; } - if (nRet == DKIM_SUCCESS) { - InitContext(pSignContext, true, pSign); - } + if (nRet == DKIM_SUCCESS) InitContext(pSignContext, true, pSign); return nRet; } @@ -71,9 +72,7 @@ int DKIM_CALL DKIMSignProcess(DKIMContext *pSignContext, char *szBuffer, int nBu { CDKIMSign *pSign = (CDKIMSign *)ValidateContext(pSignContext, true); - if (pSign) { - return pSign->Process(szBuffer, nBufLength, false); - } + if (pSign) return pSign->Process(szBuffer, nBufLength, false); return DKIM_INVALID_CONTEXT; } @@ -82,9 +81,7 @@ int DKIM_CALL DKIMSignGetSig2( { CDKIMSign *pSign = (CDKIMSign *)ValidateContext(pSignContext, true); - if (pSign) { - return pSign->GetSig2(szRSAPrivKey, szECCPrivKey, pszSignature); - } + if (pSign) return pSign->GetSig2(szRSAPrivKey, szECCPrivKey, pszSignature); return DKIM_INVALID_CONTEXT; } @@ -109,9 +106,7 @@ int DKIM_CALL DKIMVerifyInit(DKIMContext *pVerifyContext, DKIMVerifyOptions *pOp if (nRet != DKIM_SUCCESS) delete pVerify; } - if (nRet == DKIM_SUCCESS) { - InitContext(pVerifyContext, false, pVerify); - } + if (nRet == DKIM_SUCCESS) InitContext(pVerifyContext, false, pVerify); return nRet; } @@ -121,9 +116,7 @@ int DKIM_CALL DKIMVerifyProcess(DKIMContext *pVerifyContext, const char *const s { CDKIMVerify *pVerify = (CDKIMVerify *)ValidateContext(pVerifyContext, false); - if (pVerify) { - return pVerify->Process(szBuffer, nBufLength, false); - } + if (pVerify) return pVerify->Process(szBuffer, nBufLength, false); return DKIM_INVALID_CONTEXT; } @@ -132,9 +125,7 @@ int DKIM_CALL DKIMVerifyResults(DKIMContext *pVerifyContext) { CDKIMVerify *pVerify = (CDKIMVerify *)ValidateContext(pVerifyContext, false); - if (pVerify) { - return pVerify->GetResults(); - } + if (pVerify) return pVerify->GetResults(); return DKIM_INVALID_CONTEXT; } |