• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IsPGPError函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了IsPGPError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:Utils.c


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


示例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,代码来源:CLexpire.c


示例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 );
}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:55,代码来源:pgpGroupsUtil.c


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


示例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 );
}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:55,代码来源:pgpCFB.c


示例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 );
}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:51,代码来源:pgpMemoryMgrWin32.c


示例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,代码来源:AddKey.c


示例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 );
}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:28,代码来源:pgpBigNum.c


示例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;
}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:26,代码来源:pgpSockets.c


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


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


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


示例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,代码来源:KMserver.c


示例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;
}
开发者ID:ysangkok,项目名称:pgp-unix-6.5.8,代码行数:26,代码来源:pgpSockets.c


示例16: pgpSetupCallback

	PGPError
pgpSetupCallback(
	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,代码来源:pgpEncSubr.c


示例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,代码来源:CLsplash.c


示例18: pgpSigSetupHashes

/*
 * Given a bunch of signatures, setup a string of hash modules and
 * hashes in order to process the signatures.
 */
int
pgpSigSetupHashes (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,代码来源:pgpVrfySig.c


示例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,代码来源:keymaint.c


示例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,代码来源:pgpCBC.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsPassiveSpell函数代码示例发布时间:2022-05-30
下一篇:
C++ IsPC函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap