checking in some debugging statements, will remove them later
[sfa.git] / sfa / trust / certificate.py
index 4a17338..9480f7a 100644 (file)
@@ -18,6 +18,7 @@
 import os
 import tempfile
 import base64
+import traceback
 from OpenSSL import crypto
 import M2Crypto
 from M2Crypto import X509
@@ -54,7 +55,8 @@ def convert_public_key(key):
     try:
         k.load_pubkey_from_file(ssl_fn)
     except:
-        print "XXX: Error while converting key: ", key_str
+        print "XXX: Error while converting key: ", key
+        traceback.print_exc()
         k = None
 
     # remove the temporary files
@@ -514,10 +516,14 @@ class Certificate:
         # until a certificate is found that is signed by a trusted root.
 
         # TODO: verify expiration time
-
+        print "====Verify Chain====="
         # if this cert is signed by a trusted_cert, then we are set
         for trusted_cert in trusted_certs:
+            print "***************"
             # TODO: verify expiration of trusted_cert ?
+            print "CLIENT CERT", self.dump()
+            print "TRUSTED CERT", trusted_cert.dump()
+            print "Client is signed by Trusted?", self.is_signed_by_cert(trusted_cert)
             if self.is_signed_by_cert(trusted_cert):
                 #print self.get_subject(), "is signed by a root"
                 return