本文整理汇总了C++中IsPGPError函数的典型用法代码示例。如果您正苦于以下问题:C++ IsPGPError函数的具体用法?C++ IsPGPError怎么用?C++ IsPGPError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsPGPError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateTimerProc
VOID CALLBACK UpdateTimerProc(HWND hwnd,
UINT uMsg,
UINT idEvent,
DWORD dwTime)
{
PGPMemoryMgrRef memoryMgr;
PGPBoolean bUpdateAllKeys;
PGPBoolean bUpdateTrustedIntroducers;
PGPBoolean bUpdateCRLs;
PGPError err = kPGPError_NoErr;
if (idEvent != LAUNCHKEYS_TIMER)
return;
err = PGPNewMemoryMgr(0, &memoryMgr);
if (IsPGPError(err))
{
PGPclErrorBox(hwnd, err);
return;
}
err = PGPclCheckAutoUpdate(memoryMgr, FALSE,
&bUpdateAllKeys, &bUpdateTrustedIntroducers, &bUpdateCRLs);
if (IsPGPError(err))
{
PGPclErrorBox(hwnd, err);
return;
}
if (bUpdateAllKeys || bUpdateTrustedIntroducers || bUpdateCRLs)
DoLaunchKeys(hwnd);
PGPFreeMemoryMgr(memoryMgr);
return;
}
示例2: pgpWarnUser
PGPError
pgpWarnUser(
PGPContextRef context, /* Input parameters */
PGPOptionListRef optionList,
PGPError errCode,
void *warnArg
)
{
PGPError err;
PGPEventHandlerProcPtr handler;
PGPUserValue arg;
PGPOptionListRef dummyOptionList = NULL;
if( IsPGPError( err = pgpFindOptionArgs( optionList,
kPGPOptionType_EventHandler, FALSE,
"%p%p", &handler, &arg ) ) )
goto error;
if( NULL!=(int)( handler ) ) {
if( IsPGPError( err = pgpEventWarning( context, &dummyOptionList,
handler, arg, errCode, warnArg ) ) )
goto error;
pgpCleanupOptionList( &dummyOptionList );
}
return kPGPError_NoErr;
error:
return err;
}
示例3: PGPclIsExpired
PGPError PGPclExport
PGPclIsExpired(HWND hwnd)
{
PGPError err = kPGPError_NoErr;
#if BETA_TIMEOUT > 0
unsigned short month, day, year;
struct tm tm, *ptm;
time_t TimeNow, TimeoutTime;
//Get the compile date, in usable form:
TranslateDate(&month, &day, &year, __DATE__);
//Seed the tm structure with the current time:
time(&TimeNow);
ptm = localtime(&TimeNow);
memcpy(&tm, ptm, sizeof(tm));
//Set the dates to the compile time:
tm.tm_mon = month - 1;
tm.tm_mday = day;
tm.tm_year = year - 1900;
//Turn the compile time into number of secs since 1/1/1970:
TimeoutTime = mktime(&tm);
//Increment it plus the number of days in the beta timeout times the
TimeoutTime += BETA_TIMEOUT * (60 * 60 * 24); //number of seconds in a day
if(TimeoutTime < TimeNow)
{
err = kPGPError_FeatureNotAvailable;
DisplayTimeoutMessage(hwnd);
}
#endif // BETA_TIMEOUT > 0
#if PGP_DEMO
// The timeout starts at 30 days, which only disables encrypt and sign
// After 30 days, display nag screen
// After 60 days (TimeOut + 30 days), time out everything and
// delete library DLL's
err = PGPclEvalExpired(hwnd, PGPCOMDLG_ALLEXPIRED);
if (IsPGPError (err))
{
pgpFixBeforeShip ("eval version file deletion");
///??? DeleteTimeoutFile("pgpsdk.dll");
///??? DeleteTimeoutFile("pgp.dll");
DisplayTimeoutMessage(hwnd);
}
if (IsPGPError(PGPclEvalExpired(hwnd, PGPCOMDLG_ENCRYPTSIGNEXPIRED)) &&
!IsntPGPError (err))
PGPclNag(hwnd, NULL, NULL);
#endif // PGP_DEMO
return err;
}
示例4: PGPNewFlattenedGroupFromGroup
PGPError
PGPNewFlattenedGroupFromGroup(
PGPGroupSetRef sourceSet,
PGPGroupID sourceID,
PGPGroupSetRef destSet,
PGPGroupID *destID)
{
PGPError err;
PGPValidatePtr( destID );
*destID = kPGPInvalidGroupID;
PGPValidateGroupSet( sourceSet );
PGPValidateGroupSet( destSet );
PGPValidateParam( sourceSet != destSet );
err = PGPNewGroup( destSet, "", "", destID );
if( IsntPGPError( err ) )
{
PGPGroupItemIterRef iterator;
err = PGPNewGroupItemIter( sourceSet, sourceID,
kPGPGroupIterFlags_Recursive | kPGPGroupIterFlags_Keys,
&iterator );
if ( IsntPGPError( err ) )
{
PGPGroupItem item;
err = PGPGroupItemIterNext( iterator, &item );
while( IsntPGPError( err ) )
{
err = PGPAddItemToGroup( destSet, &item, *destID );
if( err == kPGPError_ItemAlreadyExists )
err = kPGPError_NoErr;
if( IsPGPError( err ) )
break;
err = PGPGroupItemIterNext( iterator, &item );
}
if ( err == kPGPError_EndOfIteration )
err = kPGPError_NoErr;
PGPFreeGroupItemIter( iterator );
}
if( IsPGPError( err ) )
{
(void) PGPDeleteGroup( destSet, *destID );
*destID = kPGPInvalidGroupID;
}
}
return( err );
}
示例5: pgpGetPGPMIMEBodyOffset
/*
* See if optionList specifies PGPMIME encoding, and if so, get MIME body
* offset and return it to caller.
*/
PGPError
pgpGetPGPMIMEBodyOffset(
PGPPipeline *pipeBuf,
PGPOptionListRef optionList)
{
PGPSize *mimeBodyOffPtr;
PGPSize mimeBodyOff;
char *mimeSeparator;
PGPUInt32 mimeHeaderLines;
PGPUInt32 mimeFlag;
PGPUInt32 lineEndFlag;
PGPLineEndType lineEnd;
PGPUInt32 uintLineEnd;
PGPError err = kPGPError_NoErr;
if( IsPGPError( err = pgpFindOptionArgs( optionList,
kPGPOptionType_PGPMIMEEncoding, FALSE,
"%d%p%p", &mimeFlag, &mimeBodyOffPtr,
&mimeSeparator) ) )
goto error;
if( mimeFlag ) {
if( NULL!=(int)( mimeBodyOffPtr ) ) {
if( IsPGPError( err = pipeBuf->annotate( pipeBuf, NULL,
PGPANN_PGPMIME_HEADER_SIZE,
(unsigned char *)&mimeBodyOff, sizeof(mimeBodyOff) ) ) )
goto error;
if( IsPGPError( err = pgpFindOptionArgs( optionList,
kPGPOptionType_OutputLineEndType, FALSE,
"%b%d", &lineEndFlag, &uintLineEnd ) ) )
goto error;
if( lineEndFlag )
lineEnd = (PGPLineEndType)uintLineEnd;
else
lineEnd = pgpGetDefaultLineEndType ();
if( lineEnd == kPGPLineEnd_CRLF ) {
if( IsPGPError( err = pipeBuf->annotate( pipeBuf, NULL,
PGPANN_PGPMIME_HEADER_LINES,
(unsigned char *)&mimeHeaderLines,
sizeof(mimeHeaderLines) ) ) )
goto error;
mimeBodyOff += mimeHeaderLines;
}
*mimeBodyOffPtr = mimeBodyOff;
}
if( NULL!=(int)( mimeSeparator ) ) {
if( IsPGPError( err = pipeBuf->annotate( pipeBuf, NULL,
PGPANN_PGPMIME_SEPARATOR,
(unsigned char *)mimeSeparator,
kPGPMimeSeparatorSize ) ) )
goto error;
}
}
error:
return err;
}
示例6: PGPCopyCFBContext
/*____________________________________________________________________________
____________________________________________________________________________*/
PGPError
PGPCopyCFBContext(
PGPCFBContextRef inRef,
PGPCFBContextRef * outRef )
{
PGPError err = kPGPError_NoErr;
PGPCFBContextRef newRef = NULL;
PGPValidatePtr( outRef );
*outRef = NULL;
PGPValidateCFB( inRef );
newRef = (PGPCFBContextRef)
PGPNewData( inRef->memoryMgr,
CalcContextSize( inRef->interleave ), 0);
if ( NULL!=(int)( newRef ) )
{
PGPUInt32 cfbIndex;
*newRef = *inRef;
/* clear each symmetric cipher in case later allocation fails */
for ( cfbIndex = 0; cfbIndex < inRef->interleave; ++cfbIndex )
{
IndCFB( newRef, cfbIndex ).symmetricRef = NULL;
}
/* copy each symmetric cipher */
for ( cfbIndex = 0; cfbIndex < inRef->interleave; ++cfbIndex )
{
err = PGPCopySymmetricCipherContext(
IndCFB( inRef, cfbIndex ).symmetricRef,
&IndCFB( newRef, cfbIndex ).symmetricRef );
if ( IsPGPError( err ) )
{
break;
}
}
if ( IsPGPError( err ) )
{
PGPFreeCFBContext( newRef );
newRef = NULL;
}
}
else
{
err = kPGPError_OutOfMemory;
}
*outRef = newRef;
return( err );
}
示例7: pgpCreateStandardMemoryMgr
PGPError
pgpCreateStandardMemoryMgr( PGPMemoryMgrRef *newMemoryMgr )
{
PGPError err = kPGPError_NoErr;
MyData * pmyData = NULL;
PGPValidatePtr( newMemoryMgr );
*newMemoryMgr = NULL;
/* allocate private data which we will store as the customValue */
pmyData = (MyData *)sInternalAlloc( sizeof( MyData ) );
if ( IsntNull( pmyData ) )
{
PGPNewMemoryMgrStruct custom;
pgpClearMemory( pmyData, sizeof( MyData ) );
err = sInitMyData( pmyData );
if ( IsntPGPError( err ) )
{
pgpClearMemory( &custom, sizeof( custom ) );
custom.customValue = (PGPUserValue)pmyData;
custom.sizeofStruct = sizeof( custom );
custom.allocProc = sWin32MemoryAllocationProc;
custom.reallocProc = sWin32MemoryReallocationProc;
custom.deallocProc = sWin32MemoryDeallocationProc;
custom.secureAllocProc = sWin32SecureMemoryAllocationProc;
custom.secureDeallocProc = sWin32SecureMemoryDeallocationProc;
err = PGPNewMemoryMgrCustom( &custom, newMemoryMgr );
if ( IsPGPError( err ) )
{
sCleanupMyData( pmyData );
}
}
if ( IsPGPError( err ) )
{
/* creation failed...dispose our private data */
sInternalFree( pmyData );
}
}
else
{
err = kPGPError_OutOfMemory;
}
return( err );
}
示例8: AddKeyFileList
BOOL AddKeyFileList(HWND hwnd,void *PGPsc,void *PGPtls,FILELIST *ListHead)
{
PGPContextRef context;
PGPtlsContextRef tls;
MYSTATE *ms;
PGPError err;
err=kPGPError_NoErr;
context=(PGPContextRef)PGPsc;
tls=(PGPtlsContextRef)PGPtls;
if(IsPGPError(PGPclEvalExpired(hwnd, PGPCL_ALLEXPIRED)))
return FALSE;
ms=(MYSTATE *)malloc(sizeof(MYSTATE));
if(ms)
{
memset(ms, 0x00, sizeof(MYSTATE) );
ms->context=context;
ms->tlsContext=tls;
ms->ListHead=ListHead;
ms->Operation=MS_ADDKEYFILELIST;
if(OpenRings(hwnd,context,&(ms->KeySet)))
{
err=SCProgressDialog(hwnd,DoWorkThread,ms,
0,"Adding Keys from File(s)...",
"","",IDR_PROGAVI);
if(!(ms->FoundPGPData))
PGPscMessageBox (hwnd,IDS_PGPERROR,IDS_NOPGPKEYSINFILE,
MB_OK|MB_ICONEXCLAMATION);
PGPFreeKeySet(ms->KeySet);
}
free(ms);
}
FreeFileList(ListHead);
if(IsPGPError(err))
return FALSE;
return TRUE;
}
示例9: PGPCopyBigNum
/* Create a new big num with same value as src */
PGPError
PGPCopyBigNum(
PGPBigNumRef src,
PGPBigNumRef * dest )
{
PGPError err = kPGPError_NoErr;
PGPBigNumRef temp = NULL;
PGPValidatePtr( dest );
*dest = NULL;
pgpValidateBigNum( src );
err = PGPNewBigNum( src->bn.mgr, src->bn.isSecure, &temp );
if ( IsntPGPError( err ) )
{
err = PGPAssignBigNum( src, temp );
if ( IsPGPError( err ) )
{
PGPFreeBigNum( temp );
temp = NULL;
}
}
*dest = temp;
return( err );
}
示例10: PGPSocketsCreateThreadStorage
PGPError
PGPSocketsCreateThreadStorage(
PGPSocketsThreadStorageRef * outPreviousStorage)
{
PGPError err = kPGPError_NoErr;
struct SThreadContext * context = NULL;
PGPValidatePtr(outPreviousStorage);
*outPreviousStorage = NULL;
context = malloc(sizeof(struct SThreadContext));
if (context != NULL) {
err = PGPGetSocketsIdleEventHandler(&context->callback,
&context->callbackData);
} else {
err = kPGPError_OutOfMemory;
}
if (IsPGPError(err) && (context != NULL)) {
free(context);
} else {
*outPreviousStorage = (PGPSocketsThreadStorageRef) context;
}
return err;
}
示例11: PGPNewSingletonKeySet
/*
* Create a singleton enumerated key set
*/
PGPError
PGPNewSingletonKeySet(
PGPKeyRef key,
PGPKeySetRef * newSet)
{
PGPContextRef context = PGPGetKeyContext(key);
EnumeratedSubsetPriv * priv;
PGPKeySetRef set;
PGPError err = kPGPError_NoErr;
PGPValidatePtr( newSet );
*newSet = NULL; /* In case there's an error */
PGPValidateKey( key );
err = NewEnumeratedSubsetInternal(key->keyDB, &set);
if (IsPGPError(err))
return err;
priv = (EnumeratedSubsetPriv *)set->priv;
priv->keyArray = (RingObject **)pgpContextMemAlloc(context,
sizeof(RingObject *), 0);
if (NULL==(int)(priv->keyArray))
{
PGPFreeKeySet(set);
return kPGPError_OutOfMemory;
}
priv->numKeys = 1;
priv->keyArray[0] = key->key;
*newSet = set;
pgpAssertErrWithPtr( err, *newSet );
return err;
}
示例12: pgpCFBCreate
PGPCFBContextRef
pgpCFBCreate(
PGPMemoryMgrRef memoryMgr,
PGPCipherVTBL const * vtbl)
{
PGPError err = kPGPError_NoErr;
PGPCFBContextRef newRef = NULL;
PGPSymmetricCipherContextRef symmetricRef = NULL;
pgpAssert( vtbl->blocksize <= PGP_CFB_MAXBLOCKSIZE );
pgpAssert( PGPMemoryMgrIsValid( memoryMgr ) );
err = PGPNewSymmetricCipherContext( memoryMgr,
vtbl->algorithm, vtbl->keysize, &symmetricRef );
if ( IsntPGPError( err ) )
{
err = PGPNewCFBContext( symmetricRef, 1, &newRef );
if ( IsPGPError( err ) )
{
PGPFreeSymmetricCipherContext( symmetricRef );
symmetricRef = NULL;
pgpAssert( NULL==(int)( newRef ) );
}
}
return newRef;
}
示例13: NewEnumeratedSubsetInternal
static PGPError
NewEnumeratedSubsetInternal(
PGPKeyDBRef db,
PGPKeySetRef * newSet)
{
PGPContextRef context = pgpGetKeyDBContext(db);
EnumeratedSubsetPriv * priv;
PGPKeySetRef set;
PGPError err = kPGPError_NoErr;
*newSet = NULL; /* In case there's an error */
priv = (EnumeratedSubsetPriv *)pgpContextMemAlloc(context,
sizeof(*priv), kPGPMemoryMgrFlags_Clear);
if (NULL==(int)(priv))
return kPGPError_OutOfMemory;
priv->keyArray = NULL;
priv->numKeys = 0;
err = pgpNewKeySetInternal(db, &set);
if (IsPGPError(err))
return err;
pgpAssertAddrValid(set, PGPKeySet);
set->priv = priv;
set->isMember = IsMemberOfEnumeratedSubset;
set->makeUnion = MakeUnionOfEnumeratedSubsets;
set->removeKey = RemoveKeyFromEnumeratedSubset;
set->destroy = DestroyEnumeratedSubset;
*newSet = set;
return kPGPError_NoErr;
}
示例14: KMDisableOnServer
BOOL
KMDisableOnServer (PKEYMAN pKM)
{
PGPKeySetRef keysetDisable = kInvalidPGPKeySetRef;
PGPError err = kPGPError_BadParams;
PGPKeyServerKeySpace space;
if (pKM->ulOptionFlags & KMF_PENDINGBUCKET)
space = kPGPKeyServerKeySpace_Normal;
else
space = kPGPKeyServerKeySpace_Default;
KMGetSelectedKeys (pKM, &keysetDisable, NULL);
if (PGPRefIsValid (keysetDisable)) {
err = PGPclDisableKeysOnServer (pKM->Context, pKM->tlsContext,
pKM->hWndParent, &pKM->keyserver,
space, pKM->KeySetMain, keysetDisable);
PGPFreeKeySet (keysetDisable);
}
if (IsPGPError (err)) PGPclErrorBox (NULL, err);
else {
KMMessageBox (pKM->hWndParent, IDS_PGP, IDS_DISABLEONSERVEROK,
MB_OK|MB_ICONINFORMATION);
}
return TRUE;
}
示例15: SocketsBlockingHook
BOOL WINAPI
SocketsBlockingHook()
{
PGPEventHandlerProcPtr eventHandler = NULL;
PGPUserValue userValue;
PGPError pgpError;
PGPRMWOLockStartReading(&sIdleEventHandlerLock);
(void) PGPThreadGetSpecific(sIdleEventHandlerIndex, (void**)&eventHandler);
(void) PGPThreadGetSpecific(sIdleEventHandlerDataIndex, &userValue);
PGPRMWOLockStopReading(&sIdleEventHandlerLock);
if (eventHandler != NULL) {
PGPEvent theEvent;
pgpClearMemory(&theEvent, sizeof(theEvent));
theEvent.type = kPGPEvent_SocketsIdleEvent;
pgpError = eventHandler(NULL, &theEvent, userValue);
if (IsPGPError(pgpError)) {
WSACancelBlockingCall();
}
}
return FALSE;
}