r3182 - trunk/libmikey/keyagreement

erik at minisip.org erik at minisip.org
Thu Feb 1 17:00:43 CET 2007


Author: erik
Date: 2007-02-01 17:00:42 +0100 (Thu, 01 Feb 2007)
New Revision: 3182

Modified:
   trunk/libmikey/keyagreement/KeyAgreementDH.cxx
Log:

 * Bug fix for mikey without GD SmartCard (broken by earlier commits today).
 * Removed some debug output



Modified: trunk/libmikey/keyagreement/KeyAgreementDH.cxx
===================================================================
--- trunk/libmikey/keyagreement/KeyAgreementDH.cxx	2007-02-01 15:39:25 UTC (rev 3181)
+++ trunk/libmikey/keyagreement/KeyAgreementDH.cxx	2007-02-01 16:00:42 UTC (rev 3182)
@@ -70,19 +70,20 @@
 	dh(NULL)
 
 {
-	
-	if (!sim){
-		cerr << "EEEE: DHBase created WITHOUT SIM"<<endl;
-		dh = new OakleyDH();
-		if( dh == NULL )
-		{
-			throw MikeyException( "Could not create "
-					"DH parameters." );
-		}
+#ifdef SCSIM_SUPPORT
+	if (sim && dynamic_cast<SipSimSmartCardGD*>(*sim)){
+		// done - DH is implemented on-card
 	}
 	else
-		cerr << "EEEE: DHBase created with SIM"<<endl;
-
+#endif
+		{
+			dh = new OakleyDH();
+			if( dh == NULL )
+			{
+				throw MikeyException( "Could not create "
+						"DH parameters." );
+			}
+		}
 }
 
 KeyAgreementDHBase::~KeyAgreementDHBase(){
@@ -140,8 +141,6 @@
 	else
 #endif
 	{
-		cerr <<"EEEE: KeyAgreementDHBase: sim is NULL or not GD sim"<< endl;
-
 		if( !dh->setGroup( groupValue ) )
 			return 1;
 
@@ -160,7 +159,6 @@
 			publicKeyPtr = new unsigned char[ length ];
 		}
 		dh->getPublicKey( publicKeyPtr, length );
-
 	}
 
 	return 0;



More information about the Minisip-devel mailing list