void External_SSL_StorageCertificateDisplayContext::OnCertificateBrowsingDone(BOOL ok, OpSSLListener::SSLCertificateOption options)
{
	m_certificate_browsing_done = TRUE;
	if (options & OpSSLListener::SSL_CERT_OPTION_OK)
	{
		for(unsigned int i=0; i< m_cert_manager->Count(); i++)
		{
			OpSSLListener::SSLCertificateSetting s = GetCertificate(i)->GetSettings();
			OpCertificateManager::Settings newSettings;
			newSettings.allow	= (s & OpSSLListener::SSL_CERT_SETTING_ALLOW_CONNECTIONS);
			newSettings.warn	= (s & OpSSLListener::SSL_CERT_SETTING_WARN_WHEN_USE);

			m_cert_manager->UpdateSettings(i, newSettings);
		}
	}
	m_display_contexts_manager->DeleteDisplayContext(this);
}
Beispiel #2
0
void main()
{
	WONIPAddress anAddr;
	WONError anError;

	WONInitialize();
	mEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
	WONAuthLoadVerifierKeyFromRegistry("SOFTWARE\\WON\\Titan", "AuthVerifierKey");
	if(!GetCertificate("Brian123","WON","suck"))
		return;

	mSession = WONRoutingCreateSession();

	WONIPAddressSetFromString(&anAddr,"localhost:8200");
	anError = WONRoutingConnect(mSession, &anAddr, mAuth, 10000);
	printf("Connection result: %s\n",WONErrorToString(anError));
	if(anError!=WONError_Success)
		return;

	WONRoutingRegisterA(mSession,"Brian123","",FALSE,FALSE,TRUE,MyRoutingRegisterClientCallback,"RegisterA");
	WaitForSingleObject(mEvent, INFINITE);

	WONRoutingGetNumUsers(mSession,MyRoutingGetNumUsersCallback,"GetNumUsers");
	WONRoutingIsUserPresentA(mSession,"test",TRUE,TRUE,MyRoutingBoolCallback,"Good IsUserPresent");
	WONRoutingIsUserPresentA(mSession,"test2",TRUE,TRUE,MyRoutingBoolCallback,"Good IsUserPresent");
	WONRoutingGetClientList(mSession,TRUE,TRUE,TRUE,MyRoutingClientListCallback,"GetClientList");
	WONRoutingGetMembersOfGroup(mSession,4,TRUE,TRUE,TRUE,MyRoutingClientListCallback,"GetChatGroup");
	WONRoutingGetMembersOfGroup(mSession,5,TRUE,TRUE,TRUE,MyRoutingClientListCallback,"GetBadGroup");
	WONRoutingGetGroupList(mSession,MyRoutingGroupListCallback,"GetGroupList");
	WONRoutingSubscribeDataObject(mSession,2,"",0,FALSE,TRUE,MyRoutingReadDataObjectCallback,"SubscribeDataObject");
	WONRoutingBroadcastChatA(mSession,"YO YO YO!!!",FALSE);
	WONRoutingBroadcastChatAndGetResultA(mSession,"YO YO YO!!!",FALSE,MyRoutingStatusCallback, "Send Chat");


	WONRoutingInstallClientJoinAttemptCallback(mSession, MyRoutingClientNameCallback, "Join Attempt");      
	WONRoutingInstallClientEnterCallback(mSession, MyRoutingClientIdWithReasonCallback, "Client Enter");     
	WONRoutingInstallClientEnterExCallback(mSession, MyRoutingClientDataWithReasonCallback, "Client Enter Ex"); 
	WONRoutingInstallClientLeaveCallback(mSession, MyRoutingClientIdWithReasonCallback, "Client Leave");     
	WONRoutingInstallSpectatorCountCallback(mSession, MyRoutingSpectatorCallback, "Spectator Count");                       
	WONRoutingInstallGroupEnterCallback(mSession, MyRoutingGroupIdAndClientIdWithReasonCallback, "Group Enter");      
	WONRoutingInstallGroupEnterExCallback(mSession, MyRoutingGroupIdAndClientDataWithReasonCallback, "Group Enter Ex");  
	WONRoutingInstallGroupLeaveCallback(mSession, MyRoutingGroupIdAndClientIdWithReasonCallback, "Group Leave");      
	WONRoutingInstallGroupSpectatorCountCallback(mSession, MyRoutingGroupIdAndSpectatorCountCallback, "Group Spectator Count"); 
	WONRoutingInstallMuteClientCallback(mSession, MyRoutingClientIdWithFlagCallback, "Mute Client");                   
	WONRoutingInstallBecomeModeratorCallback(mSession, MyRoutingClientIdWithFlagCallback, "Become Moderator");              
	WONRoutingInstallHostChangeCallback(mSession, MyRoutingClientIdCallback, "Host Change");                                 
	WONRoutingInstallDataObjectCreationCallback(mSession, MyRoutingDataObjectWithLifespanCallback, "Data Object Creation");    
	WONRoutingInstallDataObjectDeletionCallback(mSession, MyRoutingDataObjectCallback, "Data Object Deletion");                
	WONRoutingInstallDataObjectModificationCallback(mSession, MyRoutingDataObjectModificationCallback, "Data Object Modification");
	WONRoutingInstallDataObjectReplacementCallback(mSession, MyRoutingDataObjectCallback, "Data Object Replacement");             
	WONRoutingInstallKeepAliveCallback(mSession, MyRoutingVoidCallback, "Keep Alive");                                      
	WONRoutingInstallPeerDataCallback(mSession, MyRoutingMessageWithClientIdCallback, "Peer Data");                 
	WONRoutingInstallRawPeerChatCallback(mSession, MyRoutingRawChatMessageCallback, "Raw Peer Chat");                   
	WONRoutingInstallASCIIPeerChatCallback(mSession, MyRoutingASCIIChatMessageCallback, "ASCII Peer Chat");               
	WONRoutingInstallUnicodePeerChatCallback(mSession, MyRoutingUnicodeChatMessageCallback, "Unicode Peer Chat");           
	WONRoutingInstallReconnectFailureCallback(mSession, MyRoutingVoidCallback, "Reconnect Failure");                               
	

	getch();

	WONRoutingCloseSessionHandle(mSession);
	WONAuthCloseHandle(mAuth);

	WONTerminate();
	
}