[svn] dirmngr - r236 - in trunk: . po src
svn author wk
cvs at cvs.gnupg.org
Mon Sep 11 15:14:44 CEST 2006
Author: wk
Date: 2006-09-11 15:14:42 +0200 (Mon, 11 Sep 2006)
New Revision: 236
Removed:
trunk/src/maperror.c
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/autogen.sh
trunk/configure.ac
trunk/po/de.po
trunk/po/dirmngr.pot
trunk/src/ChangeLog
trunk/src/Makefile.am
trunk/src/dirmngr-client.c
trunk/src/dirmngr.c
trunk/src/server.c
trunk/src/util.h
Log:
Replaced use of assuan error codes by gpg-error codes.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/ChangeLog 2006-09-11 13:14:42 UTC (rev 236)
@@ -1,3 +1,9 @@
+2006-09-11 Werner Koch <wk at g10code.com>
+
+ * configure.ac: Require libassuan 0.9.0.
+ (AH_BOTTOM): New. Move HAVE_JNLIB_LOGGING into it
+ and define _ASSUAN_ONLY_GPG_ERRORS.
+
2006-09-04 Werner Koch <wk at g10code.com>
Released 0.9.6.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/NEWS 2006-09-11 13:14:42 UTC (rev 236)
@@ -1,3 +1,9 @@
+Noteworthy changes in version 0.9.7
+------------------------------------------------
+
+ * Internal cleanups.
+
+
Noteworthy changes in version 0.9.6 (2006-09-04)
------------------------------------------------
Modified: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/autogen.sh 2006-09-11 13:14:42 UTC (rev 236)
@@ -97,4 +97,4 @@
echo "Running autoconf..."
$AUTOCONF
-echo "You may now run \"./configure --enable-maintainer-mode && make\"."
+echo "You may now run \"./configure --enable-maintainer-mode --sysconfdir=/etc && make\"."
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/configure.ac 2006-09-11 13:14:42 UTC (rev 236)
@@ -23,14 +23,14 @@
AC_PREREQ(2.59)
min_automake_version="1.9.3"
-AC_INIT(dirmngr, 0.9.6, gpa-dev at gnupg.org)
+AC_INIT(dirmngr, 0.9.7-cvs, gpa-dev at gnupg.org)
-NEED_GPG_ERROR_VERSION=1.0
+NEED_GPG_ERROR_VERSION=1.4
NEED_LIBGCRYPT_API=1
NEED_LIBGCRYPT_VERSION=1.2.0
-NEED_LIBASSUAN_VERSION=0.6.8
+NEED_LIBASSUAN_VERSION=0.9.0
NEED_KSBA_API=1
NEED_KSBA_VERSION=1.0.0
@@ -329,12 +329,20 @@
fi
fi
-# We use jnlib, so tell other modules about it
-AC_DEFINE(HAVE_JNLIB_LOGGING, 1,
- [Defined if jnlib style logging fucntions are available])
+#
+# Stuff which goes at the bottom of config.h.
+#
+AH_BOTTOM([
+/* We use jnlib, so tell other modules about it. */
+#define HAVE_JNLIB_LOGGING 1
+/* We don't want the old assuan codes anymore. */
+#define _ASSUAN_ONLY_GPG_ERRORS 1
+])
+
+
#
# Print errors here so that they are visible all
# together and the user can acquire them all together.
Modified: trunk/po/de.po
===================================================================
--- trunk/po/de.po 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/po/de.po 2006-09-11 13:14:42 UTC (rev 236)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: dirmngr 0.9.2\n"
"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n"
-"POT-Creation-Date: 2006-09-04 14:49+0200\n"
+"POT-Creation-Date: 2006-09-11 14:27+0200\n"
"PO-Revision-Date: 2006-09-04 14:59+0200\n"
"Last-Translator: Werner Koch <wk at g10code.com>\n"
"Language-Team: de\n"
@@ -15,7 +15,7 @@
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: jnlib/logging.c:609
+#: jnlib/logging.c:619
#, c-format
msgid "you found a bug ... (%s:%d)\n"
msgstr "Sie haben einen Bug (Softwarefehler) gefunden ... (%s:%d)\n"
@@ -103,7 +103,7 @@
msgid " runtime cached certificates: %u\n"
msgstr "zur Laufzeit zwischengespeicherte Zertifikate: %u\n"
-#: src/certcache.c:480 src/dirmngr-client.c:365
+#: src/certcache.c:480 src/dirmngr-client.c:366
msgid "certificate already cached\n"
msgstr "Zertifikat ist bereits im Zwischenspeicher\n"
@@ -111,7 +111,7 @@
msgid "certificate cached\n"
msgstr "Zertifikat wurde zwischengespeichert\n"
-#: src/certcache.c:484 src/certcache.c:504 src/dirmngr-client.c:369
+#: src/certcache.c:484 src/certcache.c:504 src/dirmngr-client.c:370
#, c-format
msgid "error caching certificate: %s\n"
msgstr "Fehler beim Zwischenspeichern des Zertifikats: %s\n"
@@ -233,7 +233,7 @@
msgid "unsupported record type in `%s' line %u skipped\n"
msgstr "Nicht unterstützter Datensatztyp in `%s', Zeile %u übergangen\n"
-#: src/crlcache.c:573 src/crlcache.c:802 src/dirmngr.c:1229
+#: src/crlcache.c:573 src/crlcache.c:802 src/dirmngr.c:1230
#, c-format
msgid "error reading `%s': %s\n"
msgstr "Fehler beim Lesen von `%s': %s\n"
@@ -880,156 +880,156 @@
msgid "%s is too old (need %s, have %s)\n"
msgstr "%s ist zu alt (benötige %s, habe %s)\n"
-#: src/dirmngr.c:615
+#: src/dirmngr.c:616
#, c-format
msgid "NOTE: no default option file `%s'\n"
msgstr "Hinweis: Voreingestellte Optionendatei `%s' nicht vorhanden\n"
-#: src/dirmngr.c:620 src/dirmngr.c:1286
+#: src/dirmngr.c:621 src/dirmngr.c:1287
#, c-format
msgid "option file `%s': %s\n"
msgstr "Optionendatei `%s': %s\n"
-#: src/dirmngr.c:628
+#: src/dirmngr.c:629
#, c-format
msgid "reading options from `%s'\n"
msgstr "Optionen werden von `%s' gelesen\n"
-#: src/dirmngr.c:728
+#: src/dirmngr.c:729
#, c-format
msgid "WARNING: running with faked system time %s\n"
msgstr "WARNUNG: Prozess läuft mit getürkter Systemzeit %s\n"
-#: src/dirmngr.c:805
+#: src/dirmngr.c:806
msgid "colons are not allowed in the socket name\n"
msgstr "Doppelpunkte sind im Namen des Sockets nicht erlaubt\n"
-#: src/dirmngr.c:810
+#: src/dirmngr.c:811
msgid "name of socket too long\n"
msgstr "Name des Sockets ist zu lang\n"
-#: src/dirmngr.c:817
+#: src/dirmngr.c:818
#, c-format
msgid "can't create socket: %s\n"
msgstr "Fehler beim Erzeugen des Sockets: %s\n"
-#: src/dirmngr.c:836
+#: src/dirmngr.c:837
#, c-format
msgid "error binding socket to `%s': %s\n"
msgstr "Fehler beim Binden des Sockets an `%s': %s\n"
-#: src/dirmngr.c:845
+#: src/dirmngr.c:846
#, c-format
msgid "listen() failed: %s\n"
msgstr "listen() fehlgeschlagen: %s\n"
-#: src/dirmngr.c:851
+#: src/dirmngr.c:852
#, c-format
msgid "listening on socket `%s'\n"
msgstr "Anfragen werden auf Socket `%s' engegengenommen\n"
-#: src/dirmngr.c:857
+#: src/dirmngr.c:858
#, c-format
msgid "fork failed: %s\n"
msgstr "fork() fehlgeschlagen: %s\n"
-#: src/dirmngr.c:875
+#: src/dirmngr.c:876
msgid "out of core\n"
msgstr "Nicht genügend Hauptspeicher vorhanden\n"
-#: src/dirmngr.c:914
+#: src/dirmngr.c:915
#, c-format
msgid "setsid() failed: %s\n"
msgstr "setsid() fehlgeschlagen: %s\n"
-#: src/dirmngr.c:924
+#: src/dirmngr.c:925
#, c-format
msgid "chdir to / failed: %s\n"
msgstr "chdir nach / fehlgeschlagen: %s\n"
-#: src/dirmngr.c:979
+#: src/dirmngr.c:980
#, c-format
msgid "fetching CRL from `%s' failed: %s\n"
msgstr "Holen der CRL von `%s' fehlgeschlagen: %s\n"
-#: src/dirmngr.c:985
+#: src/dirmngr.c:986
#, c-format
msgid "processing CRL from `%s' failed: %s\n"
msgstr "Verarbeitung der CRL von `%s' fehlgeschlagen: %s\n"
-#: src/dirmngr.c:1133
+#: src/dirmngr.c:1134
#, c-format
msgid "error opening `%s': %s\n"
msgstr "Fehler beim Öffnen von `%s': %s\n"
-#: src/dirmngr.c:1150
+#: src/dirmngr.c:1151
#, c-format
msgid "%s:%u: line too long - skipped\n"
msgstr "%s:%u: Zeile ist zu lang - übergangen\n"
-#: src/dirmngr.c:1178
+#: src/dirmngr.c:1179
#, c-format
msgid "%s:%u: no hostname given\n"
msgstr "%s:%u: Kein Hostname angegeben\n"
-#: src/dirmngr.c:1197
+#: src/dirmngr.c:1198
#, c-format
msgid "%s:%u: password given without user\n"
msgstr "%s:%u: Passwort angegeben ohne Username\n"
-#: src/dirmngr.c:1218
+#: src/dirmngr.c:1219
#, c-format
msgid "%s:%u: skipping this line\n"
msgstr "%s:%u: Diese Zeile wird übersprungen\n"
-#: src/dirmngr.c:1318
+#: src/dirmngr.c:1319
msgid "SIGHUP received - re-reading configuration and flushing caches\n"
msgstr ""
"SIGHUP empfangen - lese die Konfiguration erneut und lösche die "
"Zwischenspeicher\n"
-#: src/dirmngr.c:1332
+#: src/dirmngr.c:1333
msgid "SIGUSR2 received - no action defined\n"
msgstr "SIGUSR2 empfangen - keine Aktion definiert\n"
-#: src/dirmngr.c:1337
+#: src/dirmngr.c:1338
msgid "SIGTERM received - shutting down ...\n"
msgstr "SIGTERM empfangen - wird heruntergefahren ...\n"
-#: src/dirmngr.c:1339
+#: src/dirmngr.c:1340
#, c-format
msgid "SIGTERM received - still %d active connections\n"
msgstr "SIGTERM empfangen - immer noch %d Verbindungen aktiv\n"
-#: src/dirmngr.c:1344
+#: src/dirmngr.c:1345
msgid "shutdown forced\n"
msgstr "Herunterfahren wurde erzwungen\n"
-#: src/dirmngr.c:1352
+#: src/dirmngr.c:1353
msgid "SIGINT received - immediate shutdown\n"
msgstr "SIGINT empfangen - wird sofort heruntergefahren\n"
-#: src/dirmngr.c:1359
+#: src/dirmngr.c:1360
#, c-format
msgid "signal %d received - no action defined\n"
msgstr "Signal %d empfangen - keine Aktion definiert\n"
-#: src/dirmngr.c:1373
+#: src/dirmngr.c:1374
#, c-format
msgid "handler for fd %d started\n"
msgstr "Routine für fd %d gestartet\n"
-#: src/dirmngr.c:1378
+#: src/dirmngr.c:1379
#, c-format
msgid "handler for fd %d terminated\n"
msgstr "Routine für fd %d beendet\n"
-#: src/dirmngr.c:1434
+#: src/dirmngr.c:1435
#, c-format
msgid "accept failed: %s - waiting 1s\n"
msgstr "accept() fehlgeschlagen: %s - warte 1s\n"
-#: src/dirmngr.c:1441
+#: src/dirmngr.c:1442
#, c-format
msgid "error spawning connection handler: %s\n"
msgstr "Fehler beim Starten des Verbindungshandler: %s\n"
@@ -1326,71 +1326,71 @@
msgid "OCSP responder returned a non-current status\n"
msgstr "OCSP Responder gab einen nicht aktuellen Status zurück\n"
-#: src/server.c:132 src/server.c:244
+#: src/server.c:111 src/server.c:223
#, c-format
msgid "assuan_inquire(%s) failed: %s\n"
msgstr "assuan_inquire(%s) fehlgeschlagen: %s\n"
-#: src/server.c:377
+#: src/server.c:355
msgid "serialno missing in cert ID"
msgstr "Seriennummer fehlt in der Cert-ID"
-#: src/server.c:428 src/server.c:544 src/server.c:623 src/server.c:781
-#: src/server.c:809 src/server.c:833 src/server.c:886 src/server.c:955
+#: src/server.c:406 src/server.c:520 src/server.c:597 src/server.c:753
+#: src/server.c:781 src/server.c:805 src/server.c:856 src/server.c:923
#, c-format
msgid "command %s failed: %s\n"
msgstr "Kommando %s fehlgeschlagen: %s\n"
-#: src/server.c:514 src/server.c:596 src/server.c:865 src/server.c:918
+#: src/server.c:491 src/server.c:571 src/server.c:836 src/server.c:887
#, c-format
msgid "assuan_inquire failed: %s\n"
msgstr "assuan_inquire fehlgeschlagen: %s\n"
-#: src/server.c:700
+#: src/server.c:673
#, c-format
msgid "start_cert_fetch failed: %s\n"
msgstr "start_cert_fetch fehlgeschlagen: %s\n"
-#: src/server.c:733
+#: src/server.c:706
#, c-format
msgid "fetch_next_cert failed: %s\n"
msgstr "fetch_next_cert fehlgeschlagen: %s\n"
-#: src/server.c:752
+#: src/server.c:725
#, c-format
msgid "error sending data: %s\n"
msgstr "Fehler beim Senden der Daten: %s\n"
-#: src/server.c:761
+#: src/server.c:733
#, c-format
msgid "max_replies %d exceeded\n"
msgstr "max_replies %d überschritten\n"
-#: src/server.c:829
+#: src/server.c:801
msgid "no data stream"
msgstr "Kein Datenstrom"
-#: src/server.c:1008
+#: src/server.c:976
#, c-format
msgid "can't allocate control structure: %s\n"
msgstr "Fehler beim Erzeugen der Kontrollstruktur: %s\n"
-#: src/server.c:1031
+#: src/server.c:999
#, c-format
msgid "failed to initialize the server: %s\n"
msgstr "Fehler beim Initialisieren des Servers: %s\n"
-#: src/server.c:1039
+#: src/server.c:1007
#, c-format
msgid "failed to the register commands with Assuan: %s\n"
msgstr "Fehler beim Registrieren der Kommandos gegen Assuan: %s\n"
-#: src/server.c:1059
+#: src/server.c:1027
#, c-format
msgid "Assuan accept problem: %s\n"
msgstr "Assuan accept Problem: %s\n"
-#: src/server.c:1066
+#: src/server.c:1034
#, c-format
msgid "Assuan processing failed: %s\n"
msgstr "Assuan Verarbeitung fehlgeschlagen: %s\n"
@@ -1591,94 +1591,94 @@
"The Prozess gibt 0 zurück wenn das Zertifikat gültig ist, 1 wenn es nicht\n"
"gültig ist und weitere Werte bei anderen Fehlern.\n"
-#: src/dirmngr-client.c:265 src/dirmngr-client.c:970
+#: src/dirmngr-client.c:266 src/dirmngr-client.c:970
#, c-format
msgid "error reading certificate from stdin: %s\n"
msgstr "Fehler beim Lesen des Zertifikats von der Standardeingabe: %s\n"
-#: src/dirmngr-client.c:272
+#: src/dirmngr-client.c:273
#, c-format
msgid "error reading certificate from `%s': %s\n"
msgstr "Fehler beim Lesen des Zertifikats von `%s': %s\n"
-#: src/dirmngr-client.c:286
+#: src/dirmngr-client.c:287
msgid "certificate too large to make any sense\n"
msgstr "Zertifikat ist zu groß um Sinnvoll zu sein\n"
-#: src/dirmngr-client.c:312
+#: src/dirmngr-client.c:313
#, c-format
msgid "lookup failed: %s\n"
msgstr "Aufsuchen fehlgeschlagen: %s\n"
-#: src/dirmngr-client.c:327
+#: src/dirmngr-client.c:328
#, c-format
msgid "loading CRL `%s' failed: %s\n"
msgstr "Laden der CRL von `%s' fehlgeschlagen: %s\n"
-#: src/dirmngr-client.c:355
+#: src/dirmngr-client.c:356
msgid "a dirmngr daemon is up and running\n"
msgstr "Ein dirmngr ist vorhanden und aktiv\n"
-#: src/dirmngr-client.c:377
+#: src/dirmngr-client.c:378
#, c-format
msgid "validation of certificate failed: %s\n"
msgstr "Prüfung des Zertifikats fehlgeschlagen: %s\n"
-#: src/dirmngr-client.c:384 src/dirmngr-client.c:981
+#: src/dirmngr-client.c:385 src/dirmngr-client.c:981
msgid "certificate is valid\n"
msgstr "Zertifikat ist gültig\n"
-#: src/dirmngr-client.c:390 src/dirmngr-client.c:989
+#: src/dirmngr-client.c:391 src/dirmngr-client.c:989
msgid "certificate has been revoked\n"
msgstr "Zertifikat wurde widerrufen\n"
-#: src/dirmngr-client.c:395 src/dirmngr-client.c:991
+#: src/dirmngr-client.c:396 src/dirmngr-client.c:991
#, c-format
msgid "certificate check failed: %s\n"
msgstr "Zertifikatprüfung fehlgeschlagen: %s\n"
-#: src/dirmngr-client.c:406
+#: src/dirmngr-client.c:407
#, c-format
msgid "got status: `%s'\n"
msgstr "Erhielt Status: `%s'\n"
-#: src/dirmngr-client.c:421
+#: src/dirmngr-client.c:422
#, c-format
msgid "error writing base64 encoding: %s\n"
msgstr "Fehler beim Schreiben der Base-64 Darstellung: %s\n"
-#: src/dirmngr-client.c:453
+#: src/dirmngr-client.c:454
msgid "apparently no running dirmngr\n"
msgstr "Offensichtlich ist kein Dirmngr vorhanden\n"
-#: src/dirmngr-client.c:458
+#: src/dirmngr-client.c:459
msgid "no running dirmngr - starting one\n"
msgstr "Dirmngr läuft nicht - ein neuer wird gestartet\n"
-#: src/dirmngr-client.c:491
+#: src/dirmngr-client.c:492
msgid "malformed DIRMNGR_INFO environment variable\n"
msgstr "Fehlerhafte DIRMNGR_INFO Variable\n"
-#: src/dirmngr-client.c:506
+#: src/dirmngr-client.c:507
#, c-format
msgid "dirmngr protocol version %d is not supported\n"
msgstr "Dirmngr Protocol Version %d wird nicht unterstützt\n"
-#: src/dirmngr-client.c:522
+#: src/dirmngr-client.c:523
msgid "can't connect to the dirmngr - trying fall back\n"
msgstr "Verbindung zum Dirmngr nicht möglich - Rückfallmethode wird versucht\n"
-#: src/dirmngr-client.c:530
+#: src/dirmngr-client.c:531
#, c-format
msgid "can't connect to the dirmngr: %s\n"
msgstr "Verbindung zum Dirmngr nicht möglich: %s\n"
-#: src/dirmngr-client.c:779
+#: src/dirmngr-client.c:780
#, c-format
msgid "unsupported inquiry `%s'\n"
msgstr "Nicht unterstützte INQUIRY `%s'\n"
-#: src/dirmngr-client.c:875
+#: src/dirmngr-client.c:876
msgid "absolute file name expected\n"
msgstr "Absoluter Dateiname erwartet\n"
Modified: trunk/po/dirmngr.pot
===================================================================
--- trunk/po/dirmngr.pot 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/po/dirmngr.pot 2006-09-11 13:14:42 UTC (rev 236)
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n"
-"POT-Creation-Date: 2006-09-04 14:49+0200\n"
+"POT-Creation-Date: 2006-09-11 14:27+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -16,7 +16,7 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: jnlib/logging.c:609
+#: jnlib/logging.c:619
#, c-format
msgid "you found a bug ... (%s:%d)\n"
msgstr ""
@@ -100,7 +100,7 @@
msgid " runtime cached certificates: %u\n"
msgstr ""
-#: src/certcache.c:480 src/dirmngr-client.c:365
+#: src/certcache.c:480 src/dirmngr-client.c:366
msgid "certificate already cached\n"
msgstr ""
@@ -108,7 +108,7 @@
msgid "certificate cached\n"
msgstr ""
-#: src/certcache.c:484 src/certcache.c:504 src/dirmngr-client.c:369
+#: src/certcache.c:484 src/certcache.c:504 src/dirmngr-client.c:370
#, c-format
msgid "error caching certificate: %s\n"
msgstr ""
@@ -225,7 +225,7 @@
msgid "unsupported record type in `%s' line %u skipped\n"
msgstr ""
-#: src/crlcache.c:573 src/crlcache.c:802 src/dirmngr.c:1229
+#: src/crlcache.c:573 src/crlcache.c:802 src/dirmngr.c:1230
#, c-format
msgid "error reading `%s': %s\n"
msgstr ""
@@ -834,154 +834,154 @@
msgid "%s is too old (need %s, have %s)\n"
msgstr ""
-#: src/dirmngr.c:615
+#: src/dirmngr.c:616
#, c-format
msgid "NOTE: no default option file `%s'\n"
msgstr ""
-#: src/dirmngr.c:620 src/dirmngr.c:1286
+#: src/dirmngr.c:621 src/dirmngr.c:1287
#, c-format
msgid "option file `%s': %s\n"
msgstr ""
-#: src/dirmngr.c:628
+#: src/dirmngr.c:629
#, c-format
msgid "reading options from `%s'\n"
msgstr ""
-#: src/dirmngr.c:728
+#: src/dirmngr.c:729
#, c-format
msgid "WARNING: running with faked system time %s\n"
msgstr ""
-#: src/dirmngr.c:805
+#: src/dirmngr.c:806
msgid "colons are not allowed in the socket name\n"
msgstr ""
-#: src/dirmngr.c:810
+#: src/dirmngr.c:811
msgid "name of socket too long\n"
msgstr ""
-#: src/dirmngr.c:817
+#: src/dirmngr.c:818
#, c-format
msgid "can't create socket: %s\n"
msgstr ""
-#: src/dirmngr.c:836
+#: src/dirmngr.c:837
#, c-format
msgid "error binding socket to `%s': %s\n"
msgstr ""
-#: src/dirmngr.c:845
+#: src/dirmngr.c:846
#, c-format
msgid "listen() failed: %s\n"
msgstr ""
-#: src/dirmngr.c:851
+#: src/dirmngr.c:852
#, c-format
msgid "listening on socket `%s'\n"
msgstr ""
-#: src/dirmngr.c:857
+#: src/dirmngr.c:858
#, c-format
msgid "fork failed: %s\n"
msgstr ""
-#: src/dirmngr.c:875
+#: src/dirmngr.c:876
msgid "out of core\n"
msgstr ""
-#: src/dirmngr.c:914
+#: src/dirmngr.c:915
#, c-format
msgid "setsid() failed: %s\n"
msgstr ""
-#: src/dirmngr.c:924
+#: src/dirmngr.c:925
#, c-format
msgid "chdir to / failed: %s\n"
msgstr ""
-#: src/dirmngr.c:979
+#: src/dirmngr.c:980
#, c-format
msgid "fetching CRL from `%s' failed: %s\n"
msgstr ""
-#: src/dirmngr.c:985
+#: src/dirmngr.c:986
#, c-format
msgid "processing CRL from `%s' failed: %s\n"
msgstr ""
-#: src/dirmngr.c:1133
+#: src/dirmngr.c:1134
#, c-format
msgid "error opening `%s': %s\n"
msgstr ""
-#: src/dirmngr.c:1150
+#: src/dirmngr.c:1151
#, c-format
msgid "%s:%u: line too long - skipped\n"
msgstr ""
-#: src/dirmngr.c:1178
+#: src/dirmngr.c:1179
#, c-format
msgid "%s:%u: no hostname given\n"
msgstr ""
-#: src/dirmngr.c:1197
+#: src/dirmngr.c:1198
#, c-format
msgid "%s:%u: password given without user\n"
msgstr ""
-#: src/dirmngr.c:1218
+#: src/dirmngr.c:1219
#, c-format
msgid "%s:%u: skipping this line\n"
msgstr ""
-#: src/dirmngr.c:1318
+#: src/dirmngr.c:1319
msgid "SIGHUP received - re-reading configuration and flushing caches\n"
msgstr ""
-#: src/dirmngr.c:1332
+#: src/dirmngr.c:1333
msgid "SIGUSR2 received - no action defined\n"
msgstr ""
-#: src/dirmngr.c:1337
+#: src/dirmngr.c:1338
msgid "SIGTERM received - shutting down ...\n"
msgstr ""
-#: src/dirmngr.c:1339
+#: src/dirmngr.c:1340
#, c-format
msgid "SIGTERM received - still %d active connections\n"
msgstr ""
-#: src/dirmngr.c:1344
+#: src/dirmngr.c:1345
msgid "shutdown forced\n"
msgstr ""
-#: src/dirmngr.c:1352
+#: src/dirmngr.c:1353
msgid "SIGINT received - immediate shutdown\n"
msgstr ""
-#: src/dirmngr.c:1359
+#: src/dirmngr.c:1360
#, c-format
msgid "signal %d received - no action defined\n"
msgstr ""
-#: src/dirmngr.c:1373
+#: src/dirmngr.c:1374
#, c-format
msgid "handler for fd %d started\n"
msgstr ""
-#: src/dirmngr.c:1378
+#: src/dirmngr.c:1379
#, c-format
msgid "handler for fd %d terminated\n"
msgstr ""
-#: src/dirmngr.c:1434
+#: src/dirmngr.c:1435
#, c-format
msgid "accept failed: %s - waiting 1s\n"
msgstr ""
-#: src/dirmngr.c:1441
+#: src/dirmngr.c:1442
#, c-format
msgid "error spawning connection handler: %s\n"
msgstr ""
@@ -1277,71 +1277,71 @@
msgid "OCSP responder returned a non-current status\n"
msgstr ""
-#: src/server.c:132 src/server.c:244
+#: src/server.c:111 src/server.c:223
#, c-format
msgid "assuan_inquire(%s) failed: %s\n"
msgstr ""
-#: src/server.c:377
+#: src/server.c:355
msgid "serialno missing in cert ID"
msgstr ""
-#: src/server.c:428 src/server.c:544 src/server.c:623 src/server.c:781
-#: src/server.c:809 src/server.c:833 src/server.c:886 src/server.c:955
+#: src/server.c:406 src/server.c:520 src/server.c:597 src/server.c:753
+#: src/server.c:781 src/server.c:805 src/server.c:856 src/server.c:923
#, c-format
msgid "command %s failed: %s\n"
msgstr ""
-#: src/server.c:514 src/server.c:596 src/server.c:865 src/server.c:918
+#: src/server.c:491 src/server.c:571 src/server.c:836 src/server.c:887
#, c-format
msgid "assuan_inquire failed: %s\n"
msgstr ""
-#: src/server.c:700
+#: src/server.c:673
#, c-format
msgid "start_cert_fetch failed: %s\n"
msgstr ""
-#: src/server.c:733
+#: src/server.c:706
#, c-format
msgid "fetch_next_cert failed: %s\n"
msgstr ""
-#: src/server.c:752
+#: src/server.c:725
#, c-format
msgid "error sending data: %s\n"
msgstr ""
-#: src/server.c:761
+#: src/server.c:733
#, c-format
msgid "max_replies %d exceeded\n"
msgstr ""
-#: src/server.c:829
+#: src/server.c:801
msgid "no data stream"
msgstr ""
-#: src/server.c:1008
+#: src/server.c:976
#, c-format
msgid "can't allocate control structure: %s\n"
msgstr ""
-#: src/server.c:1031
+#: src/server.c:999
#, c-format
msgid "failed to initialize the server: %s\n"
msgstr ""
-#: src/server.c:1039
+#: src/server.c:1007
#, c-format
msgid "failed to the register commands with Assuan: %s\n"
msgstr ""
-#: src/server.c:1059
+#: src/server.c:1027
#, c-format
msgid "Assuan accept problem: %s\n"
msgstr ""
-#: src/server.c:1066
+#: src/server.c:1034
#, c-format
msgid "Assuan processing failed: %s\n"
msgstr ""
@@ -1528,94 +1528,94 @@
"not valid and other error codes for general failures\n"
msgstr ""
-#: src/dirmngr-client.c:265 src/dirmngr-client.c:970
+#: src/dirmngr-client.c:266 src/dirmngr-client.c:970
#, c-format
msgid "error reading certificate from stdin: %s\n"
msgstr ""
-#: src/dirmngr-client.c:272
+#: src/dirmngr-client.c:273
#, c-format
msgid "error reading certificate from `%s': %s\n"
msgstr ""
-#: src/dirmngr-client.c:286
+#: src/dirmngr-client.c:287
msgid "certificate too large to make any sense\n"
msgstr ""
-#: src/dirmngr-client.c:312
+#: src/dirmngr-client.c:313
#, c-format
msgid "lookup failed: %s\n"
msgstr ""
-#: src/dirmngr-client.c:327
+#: src/dirmngr-client.c:328
#, c-format
msgid "loading CRL `%s' failed: %s\n"
msgstr ""
-#: src/dirmngr-client.c:355
+#: src/dirmngr-client.c:356
msgid "a dirmngr daemon is up and running\n"
msgstr ""
-#: src/dirmngr-client.c:377
+#: src/dirmngr-client.c:378
#, c-format
msgid "validation of certificate failed: %s\n"
msgstr ""
-#: src/dirmngr-client.c:384 src/dirmngr-client.c:981
+#: src/dirmngr-client.c:385 src/dirmngr-client.c:981
msgid "certificate is valid\n"
msgstr ""
-#: src/dirmngr-client.c:390 src/dirmngr-client.c:989
+#: src/dirmngr-client.c:391 src/dirmngr-client.c:989
msgid "certificate has been revoked\n"
msgstr ""
-#: src/dirmngr-client.c:395 src/dirmngr-client.c:991
+#: src/dirmngr-client.c:396 src/dirmngr-client.c:991
#, c-format
msgid "certificate check failed: %s\n"
msgstr ""
-#: src/dirmngr-client.c:406
+#: src/dirmngr-client.c:407
#, c-format
msgid "got status: `%s'\n"
msgstr ""
-#: src/dirmngr-client.c:421
+#: src/dirmngr-client.c:422
#, c-format
msgid "error writing base64 encoding: %s\n"
msgstr ""
-#: src/dirmngr-client.c:453
+#: src/dirmngr-client.c:454
msgid "apparently no running dirmngr\n"
msgstr ""
-#: src/dirmngr-client.c:458
+#: src/dirmngr-client.c:459
msgid "no running dirmngr - starting one\n"
msgstr ""
-#: src/dirmngr-client.c:491
+#: src/dirmngr-client.c:492
msgid "malformed DIRMNGR_INFO environment variable\n"
msgstr ""
-#: src/dirmngr-client.c:506
+#: src/dirmngr-client.c:507
#, c-format
msgid "dirmngr protocol version %d is not supported\n"
msgstr ""
-#: src/dirmngr-client.c:522
+#: src/dirmngr-client.c:523
msgid "can't connect to the dirmngr - trying fall back\n"
msgstr ""
-#: src/dirmngr-client.c:530
+#: src/dirmngr-client.c:531
#, c-format
msgid "can't connect to the dirmngr: %s\n"
msgstr ""
-#: src/dirmngr-client.c:779
+#: src/dirmngr-client.c:780
#, c-format
msgid "unsupported inquiry `%s'\n"
msgstr ""
-#: src/dirmngr-client.c:875
+#: src/dirmngr-client.c:876
msgid "absolute file name expected\n"
msgstr ""
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/src/ChangeLog 2006-09-11 13:14:42 UTC (rev 236)
@@ -1,3 +1,11 @@
+2006-09-11 Werner Koch <wk at g10code.com>
+
+ Changed everything to use Assuan with gpg-error codes.
+ * maperror.c: Removed.
+ * server.c (map_to_assuan_status): Removed.
+ * dirmngr.c (main): Set assuan error source.
+ * dirmngr-client.c (main): Ditto.
+
2006-09-04 Werner Koch <wk at g10code.com>
* crlfetch.c (crl_fetch): Implement HTTP redirection.
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/src/Makefile.am 2006-09-11 13:14:42 UTC (rev 236)
@@ -40,7 +40,7 @@
dirmngr_SOURCES = \
dirmngr.c dirmngr.h server.c crlcache.c crlfetch.c \
- certcache.c certcache.h i18n.h util.h maperror.c \
+ certcache.c certcache.h i18n.h util.h \
cdb.h cdblib.c ldap.c http.c http.h misc.c ocsp.c ocsp.h \
validate.c validate.h
@@ -53,11 +53,11 @@
dirmngr_ldap_CFLAGS = $(GPG_ERROR_CFLAGS)
dirmngr_ldap_LDFLAGS =
dirmngr_ldap_LDADD = ../jnlib/libjnlib.a $(LIBOBJS) $(GPG_ERROR_LIBS) \
- $(LDAPLIBS) @LIBINTL@ @LIBICONV@
+ $(LDAPLIBS) $(LIBINTL) $(LIBICONV)
-dirmngr_client_SOURCES = dirmngr-client.c i18n.h util.h b64enc.c maperror.c \
+dirmngr_client_SOURCES = dirmngr-client.c i18n.h util.h b64enc.c \
no-libgcrypt.c no-libgcrypt.h
dirmngr_client_LDADD = ../jnlib/libjnlib.a $(LIBOBJS) $(LIBASSUAN_LIBS) \
- $(GPG_ERROR_LIBS) @LIBINTL@ @LIBICONV@
+ $(GPG_ERROR_LIBS) $(LIBINTL) $(LIBICONV)
Modified: trunk/src/dirmngr-client.c
===================================================================
--- trunk/src/dirmngr-client.c 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/src/dirmngr-client.c 2006-09-11 13:14:42 UTC (rev 236)
@@ -197,6 +197,7 @@
/* Init Assuan. */
assuan_set_assuan_log_stream (log_get_stream ());
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
+ assuan_set_assuan_err_source (GPG_ERR_SOURCE_DEFAULT);
/* Setup I18N. */
i18n_init();
@@ -399,7 +400,7 @@
/* Print status line from the assuan protocol. */
-static assuan_error_t
+static int
status_cb (void *opaque, const char *line)
{
if (opt.verbose > 2)
@@ -408,7 +409,7 @@
}
/* Print data as retrieved by the lookup function. */
-static assuan_error_t
+static int
data_cb (void *opaque, const void *buffer, size_t length)
{
gpg_error_t err;
@@ -475,7 +476,7 @@
no_close_list[i] = -1;
/* Connect to the agent and perform initial handshaking. */
- rc = assuan_pipe_connect (&ctx, opt.dirmngr_program, (char**)argv,
+ rc = assuan_pipe_connect (&ctx, opt.dirmngr_program, argv,
no_close_list);
}
else /* Connect to a daemon. */
@@ -517,7 +518,7 @@
rc = assuan_socket_connect (&ctx, infostr, pid);
xfree (infostr);
- if (rc == ASSUAN_Connect_Failed && !only_daemon)
+ if (gpg_err_code(rc) == GPG_ERR_ASS_CONNECT_FAILED && !only_daemon)
{
log_error (_("can't connect to the dirmngr - trying fall back\n"));
opt.force_pipe_server = 1;
@@ -528,7 +529,7 @@
if (rc)
{
log_error (_("can't connect to the dirmngr: %s\n"),
- assuan_strerror (rc));
+ gpg_strerror (rc));
return NULL;
}
@@ -744,47 +745,47 @@
/* Callback for the inquire fiunction to send back the certificate. */
-static assuan_error_t
+static int
inq_cert (void *opaque, const char *line)
{
struct inq_cert_parm_s *parm = opaque;
- assuan_error_t ae;
+ gpg_error_t err;
if (!strncmp (line, "TARGETCERT", 10) && (line[10] == ' ' || !line[10]))
{
- ae = assuan_send_data (parm->ctx, parm->cert, parm->certlen);
+ err = assuan_send_data (parm->ctx, parm->cert, parm->certlen);
}
else if (!strncmp (line, "SENDCERT", 8) && (line[8] == ' ' || !line[8]))
{
/* We don't support this but dirmngr might ask for it. So
simply ignore it by sending back and empty value. */
- ae = assuan_send_data (parm->ctx, NULL, 0);
+ err = assuan_send_data (parm->ctx, NULL, 0);
}
else if (!strncmp (line, "SENDCERT_SKI", 12)
&& (line[12]==' ' || !line[12]))
{
/* We don't support this but dirmngr might ask for it. So
simply ignore it by sending back an empty value. */
- ae = assuan_send_data (parm->ctx, NULL, 0);
+ err = assuan_send_data (parm->ctx, NULL, 0);
}
else if (!strncmp (line, "SENDISSUERCERT", 14)
&& (line[14] == ' ' || !line[14]))
{
/* We don't support this but dirmngr might ask for it. So
simply ignore it by sending back an empty value. */
- ae = assuan_send_data (parm->ctx, NULL, 0);
+ err = assuan_send_data (parm->ctx, NULL, 0);
}
else
{
log_info (_("unsupported inquiry `%s'\n"), line);
- ae = ASSUAN_Inquire_Unknown;
+ err = gpg_error (GPG_ERR_ASS_UNKNOWN_INQUIRE);
/* Note that this error will let assuan_transact terminate
immediately instead of return the error to the caller. It is
not clear whether this is the desired behaviour - it may
change in future. */
}
- return ae;
+ return err;
}
@@ -793,7 +794,7 @@
static gpg_error_t
do_check (assuan_context_t ctx, const unsigned char *cert, size_t certlen)
{
- assuan_error_t ae;
+ gpg_error_t err;
struct inq_cert_parm_s parm;
memset (&parm, 0, sizeof parm);
@@ -801,12 +802,12 @@
parm.cert = cert;
parm.certlen = certlen;
- ae = assuan_transact (ctx, opt.use_ocsp? "CHECKOCSP":"CHECKCRL", NULL, NULL,
+ err = assuan_transact (ctx, opt.use_ocsp? "CHECKOCSP":"CHECKCRL", NULL, NULL,
inq_cert, &parm,
status_cb, NULL);
if (opt.verbose > 1)
- log_info ("response of dirmngr: %s\n", ae? assuan_strerror (ae): "okay");
- return map_assuan_err (ae);
+ log_info ("response of dirmngr: %s\n", err? gpg_strerror (err): "okay");
+ return err;
}
/* Check the certificate CERT,CERTLEN for validity using a CRL or OCSP.
@@ -814,7 +815,7 @@
static gpg_error_t
do_cache (assuan_context_t ctx, const unsigned char *cert, size_t certlen)
{
- assuan_error_t ae;
+ gpg_error_t err;
struct inq_cert_parm_s parm;
memset (&parm, 0, sizeof parm);
@@ -822,12 +823,12 @@
parm.cert = cert;
parm.certlen = certlen;
- ae = assuan_transact (ctx, "CACHECERT", NULL, NULL,
+ err = assuan_transact (ctx, "CACHECERT", NULL, NULL,
inq_cert, &parm,
status_cb, NULL);
if (opt.verbose > 1)
- log_info ("response of dirmngr: %s\n", ae? assuan_strerror (ae): "okay");
- return map_assuan_err (ae);
+ log_info ("response of dirmngr: %s\n", err? gpg_strerror (err): "okay");
+ return err;
}
/* Check the certificate CERT,CERTLEN for validity using dirmngrs
@@ -835,7 +836,7 @@
static gpg_error_t
do_validate (assuan_context_t ctx, const unsigned char *cert, size_t certlen)
{
- assuan_error_t ae;
+ gpg_error_t err;
struct inq_cert_parm_s parm;
memset (&parm, 0, sizeof parm);
@@ -843,19 +844,19 @@
parm.cert = cert;
parm.certlen = certlen;
- ae = assuan_transact (ctx, "VALIDATE", NULL, NULL,
+ err = assuan_transact (ctx, "VALIDATE", NULL, NULL,
inq_cert, &parm,
status_cb, NULL);
if (opt.verbose > 1)
- log_info ("response of dirmngr: %s\n", ae? assuan_strerror (ae): "okay");
- return map_assuan_err (ae);
+ log_info ("response of dirmngr: %s\n", err? gpg_strerror (err): "okay");
+ return err;
}
/* Load a CRL into the dirmngr. */
static gpg_error_t
do_loadcrl (assuan_context_t ctx, const char *filename)
{
- assuan_error_t ae;
+ gpg_error_t err;
const char *s;
char *fname, *line, *p;
@@ -892,14 +893,14 @@
}
*p = 0;
- ae = assuan_transact (ctx, line, NULL, NULL,
+ err = assuan_transact (ctx, line, NULL, NULL,
NULL, NULL,
status_cb, NULL);
if (opt.verbose > 1)
- log_info ("response of dirmngr: %s\n", ae? assuan_strerror (ae): "okay");
+ log_info ("response of dirmngr: %s\n", err? gpg_strerror (err): "okay");
xfree (line);
xfree (fname);
- return map_assuan_err (ae);
+ return err;
}
@@ -909,7 +910,6 @@
do_lookup (assuan_context_t ctx, const char *pattern)
{
gpg_error_t err;
- assuan_error_t ae;
const unsigned char *s;
char *line, *p;
struct b64state state;
@@ -939,17 +939,17 @@
*p = 0;
- ae = assuan_transact (ctx, line,
- data_cb, &state,
- NULL, NULL,
- status_cb, NULL);
+ err = assuan_transact (ctx, line,
+ data_cb, &state,
+ NULL, NULL,
+ status_cb, NULL);
if (opt.verbose > 1)
- log_info ("response of dirmngr: %s\n", ae? assuan_strerror (ae): "okay");
+ log_info ("response of dirmngr: %s\n", err? gpg_strerror (err): "okay");
err = b64enc_finish (&state);
xfree (line);
- return ae? map_assuan_err (ae) : err;
+ return err;
}
/* The body of an endless loop: Read a line from stdin, retrieve the
Modified: trunk/src/dirmngr.c
===================================================================
--- trunk/src/dirmngr.c 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/src/dirmngr.c 2006-09-11 13:14:42 UTC (rev 236)
@@ -527,6 +527,7 @@
assuan_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
assuan_set_assuan_log_stream (log_get_stream ());
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
+ assuan_set_assuan_err_source (GPG_ERR_SOURCE_DEFAULT);
/* Setup I18N. */
i18n_init();
Deleted: trunk/src/maperror.c
Modified: trunk/src/server.c
===================================================================
--- trunk/src/server.c 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/src/server.c 2006-09-11 13:14:42 UTC (rev 236)
@@ -45,40 +45,19 @@
something reasonable. */
#define MAX_CERT_LENGTH (8*1024)
-#define PARM_ERROR(t) assuan_set_error (ctx, ASSUAN_Parameter_Error, (t))
+#define PARM_ERROR(t) assuan_set_error (ctx, \
+ gpg_error (GPG_ERR_ASS_PARAMETER), (t))
/* Data used to associate an Assuan context with local server data */
-struct server_local_s {
- ASSUAN_CONTEXT assuan_ctx;
+struct server_local_s
+{
+ assuan_context_t assuan_ctx;
};
-/* Map GPG_ERR_xx error codes to Assuan status codes */
-static int
-map_to_assuan_status (int rc)
-{
- gpg_err_code_t ec = gpg_err_code (rc);
- gpg_err_source_t es = gpg_err_source (rc);
- if (!rc)
- return 0;
- if (!es)
- {
- es = GPG_ERR_SOURCE_USER_4; /* This should not happen, but we
- need to make sure to pass a new
- Assuan error code along. */
- log_debug ("map_to_assuan_status called with no error source\n");
- }
- if (ec == -1)
- ec = GPG_ERR_NO_DATA; /* That used to be ASSUAN_No_Data_Available. */
-
- return gpg_err_make (es, ec);
-}
-
-
-
/* Copy the % and + escaped string S into the buffer D and replace the
escape sequences. Note, that it is sufficient to allocate the
target string D as long as the source string S, i.e.: strlen(s)+1.
@@ -130,7 +109,7 @@
if (rc)
{
log_error (_("assuan_inquire(%s) failed: %s\n"),
- command, assuan_strerror (rc));
+ command, gpg_strerror (rc));
return NULL;
}
@@ -242,7 +221,7 @@
if (rc)
{
log_error (_("assuan_inquire(%s) failed: %s\n"), "SENDCERT_SKI",
- assuan_strerror (rc));
+ gpg_strerror (rc));
return NULL;
}
@@ -277,14 +256,13 @@
{
ctrl_t ctrl = assuan_get_pointer (ctx);
gpg_error_t err;
- assuan_error_t ae;
unsigned char *value = NULL;
size_t valuelen;
ksba_cert_t cert = NULL;
- ae = assuan_inquire( ctx, "SENDCERT", &value, &valuelen, 0);
- if (ae)
- return map_assuan_err (ae);
+ err = assuan_inquire( ctx, "SENDCERT", &value, &valuelen, 0);
+ if (err)
+ return err;
/* { */
/* FILE *fp = fopen ("foo.der", "r"); */
@@ -315,7 +293,7 @@
/* Handle OPTION commands. */
static int
-option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value)
+option_handler (assuan_context_t ctx, const char *key, const char *value)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
@@ -325,7 +303,7 @@
ctrl->force_crl_refresh = i;
}
else
- return ASSUAN_Invalid_Option;
+ return gpg_error (GPG_ERR_UNKNOWN_OPTION);
return 0;
}
@@ -427,7 +405,7 @@
if (err)
log_error (_("command %s failed: %s\n"), "ISVALID", gpg_strerror (err));
xfree (issuerhash);
- return map_to_assuan_status (err);
+ return err;
}
@@ -503,16 +481,14 @@
{
/* We do not have this certificate yet or the fingerprint has
not been given. Inquire it from the client. */
- assuan_error_t ae;
unsigned char *value = NULL;
size_t valuelen;
- ae = assuan_inquire (ctrl->server_local->assuan_ctx, "TARGETCERT",
+ err = assuan_inquire (ctrl->server_local->assuan_ctx, "TARGETCERT",
&value, &valuelen, MAX_CERT_LENGTH);
- if (ae)
+ if (err)
{
- log_error (_("assuan_inquire failed: %s\n"), assuan_strerror (ae));
- err = map_assuan_err (ae);
+ log_error (_("assuan_inquire failed: %s\n"), gpg_strerror (err));
goto leave;
}
@@ -543,7 +519,7 @@
if (err)
log_error (_("command %s failed: %s\n"), "CHECKCRL", gpg_strerror (err));
ksba_cert_release (cert);
- return map_to_assuan_status (err);
+ return err;
}
@@ -585,16 +561,14 @@
{
/* We do not have this certificate yet or the fingerprint has
not been given. Inquire it from the client. */
- assuan_error_t ae;
unsigned char *value = NULL;
size_t valuelen;
- ae = assuan_inquire (ctrl->server_local->assuan_ctx, "TARGETCERT",
+ err = assuan_inquire (ctrl->server_local->assuan_ctx, "TARGETCERT",
&value, &valuelen, MAX_CERT_LENGTH);
- if (ae)
+ if (err)
{
- log_error (_("assuan_inquire failed: %s\n"), assuan_strerror (ae));
- err = map_assuan_err (ae);
+ log_error (_("assuan_inquire failed: %s\n"), gpg_strerror (err));
goto leave;
}
@@ -622,7 +596,7 @@
if (err)
log_error (_("command %s failed: %s\n"), "CHECKOCSP", gpg_strerror (err));
ksba_cert_release (cert);
- return map_to_assuan_status (err);
+ return err;
}
@@ -640,7 +614,6 @@
{
ctrl_t ctrl = assuan_get_pointer (ctx);
gpg_error_t err = 0;
- assuan_error_t ae;
char *p;
strlist_t sl, list = NULL;
int truncated = 0, truncation_forced = 0;
@@ -742,15 +715,14 @@
/* Send the data, flush the buffer and then send an END line
as a certificate delimiter. */
- ae = assuan_send_data (ctx, value, valuelen);
- if (!ae)
- ae = assuan_send_data (ctx, NULL, 0);
- if (!ae)
- ae = assuan_write_line (ctx, "END");
- if (ae)
+ err = assuan_send_data (ctx, value, valuelen);
+ if (!err)
+ err = assuan_send_data (ctx, NULL, 0);
+ if (!err)
+ err = assuan_write_line (ctx, "END");
+ if (err)
{
- log_error (_("error sending data: %s\n"), assuan_strerror (ae));
- err = map_assuan_err (ae);
+ log_error (_("error sending data: %s\n"), gpg_strerror (err));
end_cert_fetch (fetch_context);
goto leave;
}
@@ -780,7 +752,7 @@
if (err)
log_error (_("command %s failed: %s\n"), "LOOKUP", gpg_strerror (err));
free_strlist (list);
- return map_to_assuan_status (err);
+ return err;
}
@@ -807,7 +779,7 @@
xfree (buf);
if (err)
log_error (_("command %s failed: %s\n"), "LOADCRL", gpg_strerror (err));
- return map_to_assuan_status (err);
+ return err;
}
@@ -831,7 +803,7 @@
err = crl_cache_list (fp);
if (err)
log_error (_("command %s failed: %s\n"), "LISTCRLS", gpg_strerror (err));
- return map_to_assuan_status (err);
+ return err;
}
@@ -854,16 +826,14 @@
ctrl_t ctrl = assuan_get_pointer (ctx);
gpg_error_t err;
ksba_cert_t cert = NULL;
- assuan_error_t ae;
unsigned char *value = NULL;
size_t valuelen;
- ae = assuan_inquire (ctrl->server_local->assuan_ctx, "TARGETCERT",
+ err = assuan_inquire (ctrl->server_local->assuan_ctx, "TARGETCERT",
&value, &valuelen, MAX_CERT_LENGTH);
- if (ae)
+ if (err)
{
- log_error (_("assuan_inquire failed: %s\n"), assuan_strerror (ae));
- err = map_assuan_err (ae);
+ log_error (_("assuan_inquire failed: %s\n"), gpg_strerror (err));
goto leave;
}
@@ -885,7 +855,7 @@
if (err)
log_error (_("command %s failed: %s\n"), "CACHECERT", gpg_strerror (err));
ksba_cert_release (cert);
- return map_to_assuan_status (err);
+ return err;
}
@@ -907,16 +877,14 @@
ctrl_t ctrl = assuan_get_pointer (ctx);
gpg_error_t err;
ksba_cert_t cert = NULL;
- assuan_error_t ae;
unsigned char *value = NULL;
size_t valuelen;
- ae = assuan_inquire (ctrl->server_local->assuan_ctx, "TARGETCERT",
+ err = assuan_inquire (ctrl->server_local->assuan_ctx, "TARGETCERT",
&value, &valuelen, MAX_CERT_LENGTH);
- if (ae)
+ if (err)
{
- log_error (_("assuan_inquire failed: %s\n"), assuan_strerror (ae));
- err = map_assuan_err (ae);
+ log_error (_("assuan_inquire failed: %s\n"), gpg_strerror (err));
goto leave;
}
@@ -954,18 +922,18 @@
if (err)
log_error (_("command %s failed: %s\n"), "VALIDATE", gpg_strerror (err));
ksba_cert_release (cert);
- return map_to_assuan_status (err);
+ return err;
}
/* Tell the assuan library about our commands. */
static int
-register_commands (ASSUAN_CONTEXT ctx)
+register_commands (assuan_context_t ctx)
{
static struct {
const char *name;
- int (*handler)(ASSUAN_CONTEXT, char *line);
+ int (*handler)(assuan_context_t, char *line);
} table[] = {
{ "ISVALID", cmd_isvalid },
{ "CHECKCRL", cmd_checkcrl },
@@ -1029,7 +997,7 @@
if (rc)
{
log_error (_("failed to initialize the server: %s\n"),
- assuan_strerror(rc));
+ gpg_strerror(rc));
dirmngr_exit (2);
}
@@ -1037,7 +1005,7 @@
if (rc)
{
log_error (_("failed to the register commands with Assuan: %s\n"),
- assuan_strerror(rc));
+ gpg_strerror(rc));
dirmngr_exit (2);
}
assuan_set_hello_line (ctx, "Dirmngr " VERSION " at your service");
@@ -1056,14 +1024,14 @@
break;
if (rc)
{
- log_info (_("Assuan accept problem: %s\n"), assuan_strerror (rc));
+ log_info (_("Assuan accept problem: %s\n"), gpg_strerror (rc));
break;
}
rc = assuan_process (ctx);
if (rc)
{
- log_info (_("Assuan processing failed: %s\n"), assuan_strerror (rc));
+ log_info (_("Assuan processing failed: %s\n"), gpg_strerror (rc));
continue;
}
}
@@ -1116,7 +1084,7 @@
*p++ = *text++;
}
*p = 0;
- err = map_assuan_err (assuan_write_status (ctx, keyword, buf));
+ err = assuan_write_status (ctx, keyword, buf);
}
va_end (arg_ptr);
Modified: trunk/src/util.h
===================================================================
--- trunk/src/util.h 2006-09-04 16:56:45 UTC (rev 235)
+++ trunk/src/util.h 2006-09-11 13:14:42 UTC (rev 236)
@@ -50,10 +50,8 @@
-/*-- maperror.c --*/
-gpg_error_t map_assuan_err (int err);
+
-
/* Handy malloc macros - use only them. */
#define xtrymalloc(a) gcry_malloc ((a))
#define xtrycalloc(a,b) gcry_calloc ((a),(b))
More information about the Gnupg-commits
mailing list