[Commits] (heikki) Start using DH. Loading on demand through callback causes crash.

commits at osafoundation.org commits at osafoundation.org
Tue Mar 23 11:00:12 PST 2004


Commit by: heikki
Modified files:
osaf/chandler/m2crypto/demo/ssl/server3.py 1.1 1.2

Log message:
Start using DH. Loading on demand through callback causes crash.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/osaf/chandler/m2crypto/demo/ssl/server3.py.diff?r1=text&tr1=1.1&r2=text&tr2=1.2

Index: osaf/chandler/m2crypto/demo/ssl/server3.py
diff -u osaf/chandler/m2crypto/demo/ssl/server3.py:1.1 osaf/chandler/m2crypto/demo/ssl/server3.py:1.2
--- osaf/chandler/m2crypto/demo/ssl/server3.py:1.1	Mon Mar 22 14:54:53 2004
+++ osaf/chandler/m2crypto/demo/ssl/server3.py	Tue Mar 23 10:59:42 2004
@@ -17,12 +17,15 @@
         print "***Verify Not ok"
     return ok
 
+dh1024 = None
+
 def init_dhparams():
-    #'dh1024.pem')
-    pass
+    dh1024 = DH.load_params('dh1024.pem')
 
 def tmp_dh_callback(ssl, is_export, keylength):
-    pass
+    if not dh1024:
+        init_dhparams()
+    return dh1024
 
 def setup_server_ctx():
     ctx = SSL.Context('sslv23')
@@ -32,9 +35,10 @@
     #    print "***No default verify paths"
     ctx.load_cert_chain('server.pem')
     ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert,
-                   10)#, verify_callback)
+                   10)#, verify_callback) # XXX Crash with callback
     ctx.set_options(SSL.op_all | SSL.op_no_sslv2)
-    #ctx.set_tmp_dh_callback(
+    #ctx.set_tmp_dh_callback(tmp_dh_callback)# XXX This causes crash
+    ctx.set_tmp_dh('dh1024.pem')
     if ctx.set_cipher_list('ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH') != 1:
         print "***No valid ciphers"
     if verbose_debug:



More information about the Commits mailing list