[rst-commit] r174 - /redwax-signtext-windows/trunk/Redwax SignText/Redwax SignText (MFC)/crypto.c

rst-commit at redwax.eu rst-commit at redwax.eu
Fri Jul 5 11:18:59 CEST 2024


Author: minfrin at redwax.eu
Date: Fri Jul  5 11:18:55 2024
New Revision: 174

Log:
Return the first certificate in the chain, and not the last certificate.

Modified:
    redwax-signtext-windows/trunk/Redwax SignText/Redwax SignText (MFC)/crypto.c

Modified: redwax-signtext-windows/trunk/Redwax SignText/Redwax SignText (MFC)/crypto.c
==============================================================================
--- redwax-signtext-windows/trunk/Redwax SignText/Redwax SignText (MFC)/crypto.c	(original)
+++ redwax-signtext-windows/trunk/Redwax SignText/Redwax SignText (MFC)/crypto.c	Fri Jul  5 11:18:55 2024
@@ -54,6 +54,7 @@
     while (1) {
 
 		SignTextCertificate* certificate = NULL;
+		SignTextCertificate* certificates = NULL;
 
         HCERTSTORE sys = CertOpenStore(CERT_STORE_PROV_SYSTEM,
             X509_ASN_ENCODING, 0, CERT_SYSTEM_STORE_CURRENT_USER | CERT_STORE_READONLY_FLAG, L"MY");
@@ -136,8 +137,13 @@
 
 				certificate = signtext_certificate_new(signtext, name, cert, spec, type, certificate);
 
+				if (!certificates) {
+					certificates = certificate;
+				}
+
 				break;
 			}
+#if 0
 			case AT_KEYEXCHANGE:
 			case AT_SIGNATURE:
 			{
@@ -151,14 +157,19 @@
 
 				certificate = signtext_certificate_new(signtext, name, cert, spec, type, certificate);
 
+				if (!certificates) {
+					certificates = certificate;
+				}
+
 				break;
 			}
+#endif
 			}
 
 		}
 		CertCloseStore(sys, 0);
 
-		PostMessage(signtext->hwnd, WM_CRYPTO_UPDATED, sizeof(certificate), (LPARAM)certificate);
+		PostMessage(signtext->hwnd, WM_CRYPTO_UPDATED, sizeof(certificates), (LPARAM)certificates);
 
 		/* Set a timer to wait for 2 seconds. */
 		if (!SetWaitableTimer(hTimer, &liDueTime, 0, NULL, NULL, 0))



More information about the rst-commit mailing list