[svn] GPGol - r91 - trunk/src

svn author twoaday cvs at cvs.gnupg.org
Thu Sep 8 11:05:26 CEST 2005


Author: twoaday
Date: 2005-09-08 11:05:25 +0200 (Thu, 08 Sep 2005)
New Revision: 91

Removed:
   trunk/src/HashTable.cpp
   trunk/src/HashTable.h
   trunk/src/usermap.c
   trunk/src/usermap.h
Modified:
   trunk/src/ChangeLog
   trunk/src/Makefile.am
   trunk/src/passphrase-dialog.c
Log:
Removed more unused code.



Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2005-09-07 21:43:02 UTC (rev 90)
+++ trunk/src/ChangeLog	2005-09-08 09:05:25 UTC (rev 91)
@@ -1,3 +1,10 @@
+2004-09-08  Timo Schulz  <ts at g10code.com>
+
+	* passphrase-dialog.c (lod_recipbox): Use gpgme directly
+	to resolve the keyids to userids.
+	* usermap.c, usermap.h: Removed.
+	* HashTable.cpp, HashTable.h: Removed.
+
 2005-09-07  Timo Schulz  <ts at g10code.com>
 
 	* common.c: Removed unused code.

Deleted: trunk/src/HashTable.cpp

Deleted: trunk/src/HashTable.h

Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2005-09-07 21:43:02 UTC (rev 90)
+++ trunk/src/Makefile.am	2005-09-08 09:05:25 UTC (rev 91)
@@ -36,9 +36,7 @@
 	rfc822parse.c rfc822parse.h \
         common.c intern.h	    \
 	passcache.c passcache.h     \
-        HashTable.cpp HashTable.h   \
         keycache.c keycache.h	    \
-	usermap.c  usermap.h        \
         config-dialog.c	            \
         passphrase-dialog.c         \
         recipient-dialog.c          \

Modified: trunk/src/passphrase-dialog.c
===================================================================
--- trunk/src/passphrase-dialog.c	2005-09-07 21:43:02 UTC (rev 90)
+++ trunk/src/passphrase-dialog.c	2005-09-08 09:05:25 UTC (rev 91)
@@ -81,23 +81,56 @@
 
 static void
 load_recipbox (HWND dlg, int ctlid, gpgme_ctx_t ctx)
-{    	
-    gpgme_decrypt_result_t res;
-    gpgme_recipient_t r;
-    void *usermap ;
+{
+  gpgme_decrypt_result_t res;
+  gpgme_recipient_t rset, r;
+  gpgme_ctx_t keyctx=NULL;
+  gpgme_key_t key;
+  gpgme_error_t err;
+  char *p;
+  int c=0;
+  
+  if (ctx == NULL)
+    return;
+  res = gpgme_op_decrypt_result (ctx);
+  if (res == NULL || res->recipients == NULL)
+    return;
+  rset = res->recipients;
+  for (r = rset; r; r = r->next)
+    c++;    
+  p = xcalloc (1, c*(17+2));
+  for (r = rset; r; r = r->next) {
+    strcat (p, r->keyid);
+    strcat (p, " ");
+  }
 
-    if (ctx == NULL)
-	return;
-    res = gpgme_op_decrypt_result (ctx);
-    if (res == NULL || res->recipients == NULL)
-	return;
-    usermap = new_usermap (res->recipients);
-    for (r = res->recipients; r; r = r->next) {
-	char *userid = HashTable_get (usermap, r->keyid);
-	SendDlgItemMessage (dlg, ctlid, LB_ADDSTRING, 0, 
-			    (LPARAM)(const char*)userid);
+  err = gpgme_new (&keyctx);
+  if (err)
+    goto fail;
+  err = gpgme_op_keylist_start (keyctx, p, 0);
+  if (err)
+    goto fail;
+
+  r = rset;
+  for (;;) 
+    {
+      const char *uid;
+      err = gpgme_op_keylist_next (keyctx, &key);
+      if (err)
+	break;
+      uid = gpgme_key_get_string_attr (key, GPGME_ATTR_USERID, NULL, 0);
+      if (uid != NULL) 
+	SendDlgItemMessage (dlg, ctlid, LB_ADDSTRING, 0,
+			    (LPARAM)(const char *)uid);
+	gpgme_key_release (key);
+	key = NULL;
+	r = r->next;
     }
-    free_usermap (usermap);
+
+fail:
+    if (keyctx != NULL)
+	gpgme_release (keyctx);
+    xfree (p);
 }
 
 

Deleted: trunk/src/usermap.c

Deleted: trunk/src/usermap.h




More information about the Gnupg-commits mailing list