您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ IsPGPError函数代码示例

51自学网 2021-06-01 21:42:15
  C++
这篇教程C++ IsPGPError函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中IsPGPError函数的典型用法代码示例。如果您正苦于以下问题:C++ IsPGPError函数的具体用法?C++ IsPGPError怎么用?C++ IsPGPError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了IsPGPError函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:35,


示例2: pgpWarnUser

	PGPErrorpgpWarnUser(	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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:29,


示例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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:59,


示例4: PGPNewFlattenedGroupFromGroup

	PGPErrorPGPNewFlattenedGroupFromGroup(	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 );}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:55,


示例5: pgpGetPGPMIMEBodyOffset

/* * See if optionList specifies PGPMIME encoding, and if so, get MIME body * offset and return it to caller. */	PGPErrorpgpGetPGPMIMEBodyOffset(	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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:59,


示例6: PGPCopyCFBContext

/*________________________________________________________________________________________________________________________________________________________*/PGPErrorPGPCopyCFBContext(    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 );}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:55,


示例7: pgpCreateStandardMemoryMgr

	PGPErrorpgpCreateStandardMemoryMgr( 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 );}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:51,


示例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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:48,


示例9: PGPCopyBigNum

/* Create a new big num with same value as src */	PGPErrorPGPCopyBigNum(	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 );}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:28,


示例10: PGPSocketsCreateThreadStorage

PGPErrorPGPSocketsCreateThreadStorage(	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;}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:26,


示例11: PGPNewSingletonKeySet

/* * Create a singleton enumerated key set */	PGPErrorPGPNewSingletonKeySet(	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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:36,


示例12: pgpCFBCreate

PGPCFBContextRefpgpCFBCreate(    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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:27,


示例13: NewEnumeratedSubsetInternal

	static PGPErrorNewEnumeratedSubsetInternal(	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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:35,


示例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;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:28,


示例15: SocketsBlockingHook

BOOL WINAPISocketsBlockingHook(){	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;}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:26,


示例16: pgpSetupCallback

	PGPErrorpgpSetupCallback(	PGPOptionListRef	  optionList,	PGPEventHandlerProcPtr *func,		/* Output params */	PGPUserValue		 *userValue,	PGPBoolean			 *fNullEvents	){	PGPError			  err;	PGPBoolean			  lNullEvents;	/* Init return data to default states */	pgpa( pgpaAddrValid( func, PGPEventHandlerProcPtr ) );	pgpa( pgpaAddrValid( userValue, PGPUserValue ) );	pgpa( pgpaAddrValid( fNullEvents, PGPBoolean ) );	*func = NULL;	*userValue = (PGPUserValue)0;	*fNullEvents = FALSE;	if( IsPGPError( err = pgpFindOptionArgs( optionList,						 kPGPOptionType_EventHandler, FALSE,						 "%p%p", func, userValue ) ) )		goto error;	if( IsPGPError( err = pgpFindOptionArgs( optionList,						 kPGPOptionType_SendNullEvents, FALSE,						 "%b", &lNullEvents ) ) )		goto error;	if( lNullEvents ) {		/* Wants notification of null events */		if( NULL==(int) (*func) ) {			pgpDebugMsg(				   "Error: Null events requested without event handler" );			err = kPGPError_BadParams;			goto error;		}		*fNullEvents = TRUE;	}	return kPGPError_NoErr;error:	*func = NULL;	*userValue = (PGPUserValue)0;	*fNullEvents = FALSE;	return err;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:47,


示例17: PGPclSplash

PGPError PGPclExport PGPclSplash (		PGPContextRef	Context,		HWND			hWndParent, 		UINT			uMS) {	PGPTime			LastSplash			= 0;	PGPTime			Today;	DWORD			dwID;	PGPPrefRef		PrefRef;	struct tm *		stm;	PGPError		err;	INT				iYear, iDay;	time_t			tt;	BOOL			bShowSplash;	MemMgr = PGPGetContextMemoryMgr (Context);	PGPclOpenClientPrefs (MemMgr, &PrefRef);	Today = PGPGetTime ();	tt = PGPGetStdTimeFromPGPTime (Today);	stm = localtime (&tt);	iYear = stm->tm_year;	iDay = stm->tm_yday;	if (PGPRefIsValid (PrefRef)) {		err = PGPGetPrefNumber (PrefRef, kPGPPrefDateOfLastSplashScreen, 						&LastSplash);		if (IsPGPError (err)) LastSplash = 0;	}	tt = PGPGetStdTimeFromPGPTime (LastSplash);	stm = localtime (&tt);	bShowSplash = FALSE;	if (uMS == 0) {		bShowSplash = TRUE;	}	if ((stm != NULL) &&		((stm->tm_year != iYear) || 		 (stm->tm_yday != iDay))) bShowSplash = TRUE;	if (bShowSplash)	{		if (g_hWndSplash) return kPGPError_Win32_AlreadyOpen;		g_hWndSplash = (HWND)1;		hWndSplashParent = hWndParent;		_beginthreadex (NULL, 0, sSplashThread, (PVOID)uMS, 0, &dwID); 		PGPSetPrefNumber (PrefRef, kPGPPrefDateOfLastSplashScreen, Today);		Sleep (MAINWINDOWDELAY);	}	PGPclCloseClientPrefs (PrefRef, TRUE);	return kPGPError_NoErr;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:58,


示例18: pgpSigSetupHashes

/* * Given a bunch of signatures, setup a string of hash modules and * hashes in order to process the signatures. */intpgpSigSetupHashes (PGPContextRef cdkContext,	PGPPipeline **tail,	PGPEnv const *env,	PGPHashListRef *hashlist,	PGPSig const *siglist,	PGPUICb const *ui,	void *ui_arg){	PGPUInt16 len;	int err;	PGPByte *buf;	PGPHashListRef hashes;	PGPByte const *charmap;	PGPByte const *extra;	unsigned extralen;	if (!tail || !siglist || !hashlist || !ui)		return kPGPError_BadParams;	*hashlist = NULL;	len = pgpSigDistinctHashCount (siglist);	buf = (PGPByte *)pgpContextMemAlloc( cdkContext,		len, kPGPMemoryMgrFlags_Clear);	if (!buf)		return kPGPError_OutOfMemory;	pgpSigDistinctHashes (siglist, buf);	if (!pgpDevNullCreate (cdkContext, tail)) {		ui->message (ui_arg, kPGPError_OutOfMemory, PGPMSG_DEVNULL_CREATE, 0);		pgpContextMemFree( cdkContext, buf);		return kPGPError_OutOfMemory;	}	extra = pgpSigExtra (siglist, &extralen);	charmap = (PGPByte const *)pgpenvGetPointer (env, PGPENV_CHARMAPTOLATIN1,						  NULL);	err = pgpSigSetupPipeline ( cdkContext, tail, &hashes, buf, len, 				   ((extra && extra[0]) ? charmap : NULL));	pgpContextMemFree( cdkContext, buf);	if ( IsPGPError( err ) ) {		(*tail)->teardown (*tail);		*tail = NULL;	}	if ( pgpHashListGetSize( hashes ) == 0) {		(*tail)->teardown (*tail);		*tail = NULL;		ui->message (ui_arg, kPGPError_VERBOSE_0, PGPMSG_SIG_NO_CHECK, 0);		pgpHashListDestroy( hashes );		return kPGPError_CantHash;	}	*hashlist = hashes;	return 0;}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:61,


示例19: dokeycheck

PGPError dokeycheck(struct pgpmainBones *mainbPtr, char *useridStr,        PGPFileSpecRef ringFileSpec){    PGPKeySetRef ringSet = NULL;    char *ringfile = NULL;    PGPError err, er2;    struct pgpenvBones *envbPtr = mainbPtr->envbPtr;    struct pgpfileBones *filebPtr = mainbPtr->filebPtr;    PGPEnv *env = envbPtr->m_env;    PGPInt32 pri;    PGPBoolean quietmode = pgpenvGetInt( env, PGPENV_NOOUT, &pri, &err);    PGPBoolean compatible = envbPtr->compatible;    err = PGPGetFullPathFromFileSpec( ringFileSpec, &ringfile );    pgpAssertNoErr(err);    err = PGPOpenKeyRing(mainbPtr->pgpContext, 0, ringFileSpec, &ringSet);#if 0    err = pgpOpenKeyringsFromPubringSpec( mainbPtr, ringFileSpec, &ringSet, 0);#endif 0    if( IsPGPError(err) ) goto done;    if (!quietmode) fprintf(filebPtr->pgpout,         LANG("/nKey ring: '%s'"), ringfile);    mainbPtr->workingRingSet=ringSet;    err = pgpDoCheckKeyRing(mainbPtr, useridStr);    pgpAssertNoErr(err);done:    if (ringfile)        er2 = PGPFreeData( ringfile );    if (ringSet)        er2 = PGPFreeKeySet( ringSet );    mainbPtr->workingRingSet = NULL;    if( !compatible && IsPGPError(err) &&        pgpenvGetInt( env, PGPENV_VERBOSE, &pri, &er2) )        pgpShowError(filebPtr, err, __FILE__,__LINE__);    return err;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:44,


示例20: PGPNewCBCContext

	PGPError PGPNewCBCContext(	PGPSymmetricCipherContextRef	symmetricRef,	PGPCBCContextRef *				outRef ){	PGPCBCContextRef				newRef	= NULL;	PGPError						err	= kPGPError_NoErr;	PGPMemoryMgrRef					memoryMgr	= NULL;		PGPValidatePtr( outRef );	*outRef	= NULL;	PGPValidatePtr( symmetricRef );		memoryMgr	= pgpGetSymmetricCipherMemoryMgr( symmetricRef );	newRef	= (PGPCBCContextRef)			PGPNewData( memoryMgr,				sizeof( *newRef ), 0 | kPGPMemoryMgrFlags_Clear);				if ( IsntNull( newRef ) )	{#if PGP_DEBUG		/* make original invalid to enforce semantics */		PGPSymmetricCipherContextRef	tempRef;		err	= PGPCopySymmetricCipherContext( symmetricRef, &tempRef );		if ( IsntPGPError( err ) )		{			PGPFreeSymmetricCipherContext( symmetricRef );			symmetricRef	= tempRef;		}		err	= kPGPError_NoErr;#endif		newRef->magic			= kCBCMagic;		newRef->CBCInited		= FALSE;		newRef->symmetricRef	= symmetricRef;		newRef->iv				= newRef->iv1;		newRef->memoryMgr		= memoryMgr;				/* make sure we clean up */		if ( IsPGPError( err ) )		{			PGPFreeCBCContext( newRef );			newRef	= NULL;		}	}	else	{		/* we own it, so dispose it */		PGPFreeSymmetricCipherContext( symmetricRef );		err	= kPGPError_OutOfMemory;	}		*outRef	= newRef;	return( err );}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:55,


示例21: pgpPumpMem

	PGPErrorpgpPumpMem(	PGPPipeline			*head,	PGPByte				*inBufPtr,	PGPSize				 inBufLength,	PGPProgressCallBack	 callBack,	void				 *callBackArg	){	PGPSize				totalSize;	PGPError			err = kPGPError_NoErr;	PGPSize				written;	totalSize = inBufLength;	err = head->sizeAdvise( head, inBufLength );	if( IsPGPError( err ) )		return err;	err = head->annotate (head, NULL, PGPANN_FILE_BEGIN, NULL, 0);	if( IsPGPError( err ) )		return err;	err = head->sizeAdvise( head, inBufLength );	while( inBufLength>0 && IsntPGPError( err ) ) {		written = head->write( head, inBufPtr,							   pgpMin(inBufLength, 4096), &err );		inBufPtr += written;		inBufLength -= written;		if( IsPGPError( err ) )			break;		if( NULL!=(int)( callBack ) )			err = callBack( callBackArg, totalSize - inBufLength, totalSize );	}	if( IsntPGPError( err ) )		err = head->sizeAdvise( head, 0 );	if( IsntPGPError( err ) )		err = head->annotate (head, NULL, PGPANN_FILE_END, NULL, 0);	if( IsntPGPError( err ) )		err = head->sizeAdvise( head, 0 );	return err;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:41,


示例22: CheckPGPError

bool CheckPGPError(PGPError err){	if (IsPGPError(err)) {		PGPSize ErrMsgLen = pgpErrMsgLen;		PGPGetErrorString(err, ErrMsgLen, pgpErrMsg);		return 1;	}	else {		*pgpErrMsg = '/0';		return 0;	}}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:12,


示例23: KMAddCertificate

BOOL KMAddCertificate (PKEYMAN pKM) {	PGPKeySetRef	keysetKey		= kInvalidPGPKeySetRef;	PGPKeyRef		key				= kInvalidPGPKeyRef;	PGPUserIDRef	userid			= kInvalidPGPUserIDRef;	PGPError		err;	if (KMSelectedFlags (pKM) == OBJECT_USERID)	{		userid = (PGPUserIDRef)KMFocusedObject (pKM);		key = KMGetKeyFromUserID (pKM, userid);	}	else	{		key = (PGPKeyRef)KMFocusedObject (pKM);		PGPGetPrimaryUserID (key, &userid);	}	PGPNewSingletonKeySet (key, &keysetKey);	if (PGPRefIsValid (keysetKey)) 	{		err = PGPclSendCertificateRequestToServer (									pKM->Context, 									pKM->tlsContext,									pKM->hWndParent, 									pKM->KeySetMain,									userid,									keysetKey);		PGPFreeKeySet (keysetKey);	}	if (err == kPGPError_InvalidProperty)	{		if (KMIsThisTheOnlyUserID (pKM, userid))			KMMessageBox (pKM->hWndParent, IDS_CAPTION, 					IDS_CANTDERIVEATTRIBUTESONLY, MB_OK|MB_ICONEXCLAMATION);		else			KMMessageBox (pKM->hWndParent, IDS_CAPTION, 					IDS_CANTDERIVEATTRIBUTES, MB_OK|MB_ICONEXCLAMATION);	}	else if (IsPGPError (err))	{		PGPclErrorBox (pKM->hWndParent, err);	}	else	{		KMMessageBox (pKM->hWndParent, IDS_PGP, 				IDS_CERTIFICATEREQUESTED, MB_OK|MB_ICONINFORMATION);	}	return TRUE;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:53,


示例24: pgpGetMinValidity

	PGPErrorpgpGetMinValidity(	PGPOptionListRef	 optionList,	PGPValidity			*failValidity,	/* Output parameters */	PGPValidity			*warnValidity	){	PGPError			 err;	PGPOption			 op;	PGPUInt32			temp;	/* Init return pointers */	pgpa( pgpaAddrValid( failValidity, PGPValidity ) );	pgpa( pgpaAddrValid( warnValidity, PGPValidity ) );	/* XXX Need to fix these based on trust model and other aspects */	*failValidity = kPGPValidity_Unknown;	*warnValidity = kPGPValidity_Marginal;	if( IsPGPError( err = pgpSearchOptionSingle( optionList,						  kPGPOptionType_FailBelowValidity, &op ) ) )		goto error;	if( IsOp( op ) ) {				if( IsPGPError( err = pgpOptionUInt( &op, &temp ) ) )			goto error;		*failValidity	= (PGPValidity)temp;	}	if( IsPGPError( err = pgpSearchOptionSingle( optionList,						  kPGPOptionType_WarnBelowValidity, &op ) ) )		goto error;	if( IsOp( op ) ) {		if( IsPGPError( err = pgpOptionUInt( &op, &temp ) ) )			goto error;		*warnValidity	= (PGPValidity)temp;	}	return kPGPError_NoErr;error:	return err;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:40,


示例25: PGPsdkUIErrorBox

static PGPErrorPGPsdkUIErrorBox(PGPError error) {	PGPError	err				= kPGPError_NoErr;	char		szMessage[512];		if (IsPGPError (error) && (error!=kPGPError_UserAbort)) {		PGPGetErrorString (error, sizeof(szMessage), szMessage);		printf("%s: PGP Error", szMessage);	}	return err;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:13,


示例26: pgpVirtMaskOR

PGPErrorpgpVirtMaskOR (RingPool const *pool, PGPVirtMask const *imask,	PGPVirtMask *omask){	PGPError err;	PGPUInt32 i;	err = pgpVirtMaskSizeUp (pool, omask, imask->nwords);	if (IsPGPError (err))		return err;	for (i=0; i<pgpMin(imask->nwords, omask->nwords); ++i)		omask->words[i] |= imask->words[i];	return kPGPError_NoErr;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:14,


示例27: pkcs8Decrypt

/* processes a PKCS #8 EncryptedPrivateKeyInfo ASN.1 blob */static PGPErrorpkcs8Decrypt (    PGPContextRef		context,	/* [IN] */    const PGPByte		*pass,		/* [IN] */    PGPSize			passsize,	/* [IN] */    const PGPByte		*encdata,	/* [IN] data to decrypt */    PGPSize			encdatasize,	/* [IN] size of data to decrypt						   (bytes) */    PKICONTEXT			*pki,		/* [IN] asn.1 compiler						   context */    PGPByte			**privkey,	/* [OUT] PrivateKeyInfo ASN.1 */    PGPSize			*privkeysize)	/* [OUT] asn.1 binary size */{    int				asnerr = 0;    PKIEncryptedPrivateKeyInfo	*pkcs8;#if 0    PKIPrivateKeyInfo		*privkeyinfo;#endif    PGPError			err;    PKIUnpackEncryptedPrivateKeyInfo (pki, &pkcs8, encdata, encdatasize,&asnerr);    if (asnerr)	return kPGPError_NoErr; /* can't process this */    err = pkcs12Decrypt(context, pass, passsize,			pkcs8->encryptedData.val, pkcs8->encryptedData.len,			&pkcs8->encryptionAlgorithm, pki,			privkey, privkeysize);    if (IsPGPError (err))	goto error;#if 0    /* test the result of the decryption */    PKIUnpackPrivateKeyInfo (pki, &privkeyinfo, *privkey, *privkeysize, &asnerr);    if (asnerr)    {	err = kPGPError_LazyProgrammer;	goto error;    }    PKIFreePrivateKeyInfo (pki, privkeyinfo);#endif    err = kPGPError_NoErr;error:    if (pkcs8)	PKIFreeEncryptedPrivateKeyInfo(pki,pkcs8);    return err;}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:51,


示例28: pgpSigSetupPipeline

intpgpSigSetupPipeline (	PGPContextRef cdkContext,	PGPPipeline **head,	PGPHashListRef *hashes,	PGPByte const *hashlist,	PGPUInt16 hashlen,	PGPByte const *charmap){	int num;	PGPPipeline *mod = NULL, **tail = &mod;	PGPError error;	PGPMemoryMgrRef	memoryMgr	= PGPGetContextMemoryMgr( cdkContext );	pgpAssertAddrValid( head, PGPPipeline );	pgpAssertAddrValid( hashes, PGPHashListRef );	pgpAssertAddrValid( hashlist, PGPByte );		if (!head || !hashes || !hashlist || hashlen == 0 )		return 0;	error = pgpHashListCreate ( memoryMgr, hashlist, hashes, hashlen);	if( IsPGPError( error ) )		return error;	num = pgpHashListGetSize( *hashes );	if (num <= 0)		return 0;	if (charmap) {		tail = pgpTextFiltCreate ( cdkContext,			tail, charmap, 0, kPGPLineEnd_CRLF);		if (!tail) {			pgpHashListDestroy (*hashes);			return kPGPError_OutOfMemory;		}	}	tail = pgpHashModListCreate ( cdkContext, tail, *hashes, num);	if (!tail) {		pgpHashListDestroy (*hashes);		mod->teardown (mod);		return kPGPError_OutOfMemory;	}	/* splice in the modules */	*tail = *head;	*head = mod;	return 0;}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:50,


示例29: sAddAllKeysToGroup

	static PGPErrorsAddAllKeysToGroup(	PGPGroupSetRef	set,	PGPGroupID		id,	PGPKeySetRef	keySet ){	PGPError		err	= kPGPError_NoErr;	PGPKeyListRef	keyList;		err = PGPOrderKeySet( keySet, kPGPAnyOrdering, &keyList );	if( IsntPGPError( err ) )	{		PGPKeyIterRef	iter;				err = PGPNewKeyIter( keyList, &iter );		if( IsntPGPError( err ) )		{			PGPKeyRef		key;						while( IsntPGPError( err = PGPKeyIterNext( iter, &key ) ) )			{				PGPKeyID	keyID;								err	= PGPGetKeyIDFromKey( key, &keyID );				if ( IsntPGPError( err ) )				{					PGPGroupItem	item;					PGPInt32		algorithm;										item.type				= kPGPGroupItem_KeyID;					item.u.key.keyID		= keyID;					PGPGetKeyNumber( key, kPGPKeyPropAlgID, &algorithm);					item.u.key.algorithm	= (PGPPublicKeyAlgorithm) algorithm;											err	= PGPAddItemToGroup( set, &item, id);										if ( IsPGPError( err ) )						break;				}			}						if( err == kPGPError_EndOfIteration )				err = kPGPError_NoErr;							(void) PGPFreeKeyIter( iter );		}		(void) PGPFreeKeyList( keyList );	}	return( err );}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:50,


示例30: pgpVirtMaskSetBit

PGPErrorpgpVirtMaskSetBit (RingPool const *pool, PGPVirtMask *mask,	PGPUInt32 bitnumber){	PGPUInt32 bitword;	PGPError err;	bitword = bitnumber / 32;	err = pgpVirtMaskSizeUp (pool, mask, bitword + 1);	if (IsPGPError(err))		return err;	mask->words[bitword] |= 1 << (bitnumber % 32);	return kPGPError_NoErr;}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:14,



注:本文中的IsPGPError函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ IsPassiveSpell函数代码示例
C++ IsPC函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。