Decryption does now work
[gnupg.git] / sm / certpath.c
index aef1612..9b98ce8 100644 (file)
@@ -46,12 +46,11 @@ gpgsm_validate_path (KsbaCert cert)
   if (!kh)
     {
       log_error (_("failed to allocated keyDB handle\n"));
-      rc = GPGSM_General_Error;
+      rc = GNUPG_General_Error;
       goto leave;
     }
 
-  log_debug ("validate path for certificate:\n");
-  gpgsm_dump_cert (cert);
+  gpgsm_dump_cert ("subject", cert);
 
   subject_cert = cert;
 
@@ -66,7 +65,7 @@ gpgsm_validate_path (KsbaCert cert)
         {
           if (DBG_X509)
             log_debug ("ERROR: issuer missing\n");
-          rc = GPGSM_Bad_Certificate;
+          rc = GNUPG_Bad_Certificate;
           goto leave;
         }
 
@@ -75,7 +74,7 @@ gpgsm_validate_path (KsbaCert cert)
           if (gpgsm_check_cert_sig (subject_cert, subject_cert) )
             {
               log_debug ("selfsigned certificate has a BAD signatures\n");
-              rc = depth? GPGSM_Bad_Certificate_Path : GPGSM_Bad_Certificate;
+              rc = depth? GNUPG_Bad_Certificate_Path : GNUPG_Bad_Certificate;
               goto leave;
             }
           log_debug ("selfsigned certificate is good\n");
@@ -87,11 +86,11 @@ gpgsm_validate_path (KsbaCert cert)
 
       /* find the next cert up the tree */
       keydb_search_reset (kh);
-      rc = keydb_search_issuer (kh, issuer);
+      rc = keydb_search_subject (kh, issuer);
       if (rc)
         {
           log_debug ("failed to find issuer's certificate: rc=%d\n", rc);
-          rc = GPGSM_Missing_Certificate;
+          rc = GNUPG_Missing_Certificate;
           goto leave;
         }
 
@@ -100,17 +99,17 @@ gpgsm_validate_path (KsbaCert cert)
       if (rc)
         {
           log_debug ("failed to get cert: rc=%d\n", rc);
-          rc = GPGSM_General_Error;
+          rc = GNUPG_General_Error;
           goto leave;
         }
 
       log_debug ("got issuer's certificate:\n");
-      gpgsm_dump_cert (issuer_cert);
+      gpgsm_dump_cert ("issuer", issuer_cert);
 
       if (gpgsm_check_cert_sig (issuer_cert, subject_cert) )
         {
           log_debug ("certificate has a BAD signatures\n");
-          rc = GPGSM_Bad_Certificate_Path;
+          rc = GNUPG_Bad_Certificate_Path;
           goto leave;
         }
       log_debug ("certificate is good\n");