diff --git a/.gitignore b/.gitignore index 5074f03..338b953 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,15 @@ Makefile.in aclocal.m4 autom4te.cache/ config.h.in configure doc/Makefile.in doc/manual/Makefile.in doc/manual/scute.info doc/manual/stamp-vti doc/manual/version.texi m4/Makefile.in obj/ src/Makefile.in tests/Makefile.in +/VERSION diff --git a/ChangeLog b/ChangeLog index 20b4e01..ac678aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,593 +1 @@ -2010-04-21 Marcus Brinkmann - - Release 1.4.0. - - * configure.ac (NEED_LIBASSUAN_VERSION): Bump to 2.0.0. - (LIBSCUTE_LT_REVISION): Bump to 2. - -2009-12-08 Marcus Brinkmann - - * src/agent.c (agent_connect): Convert posix fd to assuan fd. - * src/cert-gpgsm.c (export_cert_compat): Likewise. - - * src/Makefile.am (libgpg-error.a, libassuan.a): Force symlink. - -2009-11-06 Marcus Brinkmann - - * src/cert-gpgsm.c (export_cert_compat, export_cert) - (scute_gpgsm_search_certs_by_grip) - (scute_gpgsm_search_certs_by_fpr): Call assuan_pipe_connect - instead of assuan_pipe_connect_ext. - * src/agent.c (agent_connect): Update use of assuan_socket_connect - and assuan_pipe_connect. - -2009-10-16 Marcus Brinkmann - - * src/p11-initialize.c (CK_DEFINE_FUNCTION): Fix code on - non-Windows. - -2009-10-08 Marcus Brinkmann - - * src/p11-initialize.c (C_Initialize): Call WSAStartup. - * src/p11-finalize.c (CK_DEFINE_FUNCTION): Call WSACleanup. - -2009-10-06 Marcus Brinkmann - - * src/pkcs11.h: Add support for GOST. By Andreas Jellinghaus. - -2009-09-23 Marcus Brinkmann - - * configure.ac (NEED_LIBASSUAN_VERSION): Update to 1.1.0. - (_ASSUAN_ONLY_GPG_ERROR): Remove. - * src/p11-initialize.c: Update to new Assuan interface. - * src/debug.c (_scute_debug_init): Remove call to - assuan_set_assuan_log_stream. - * src/agent.c (agent_connect): Allocate assuan context before - connecting to server. Release it on error. - * src/cert-gpgsm.c (export_cert_compat, export_cert) - (scute_gpgsm_search_certs_by_grip) - (scute_gpgsm_search_certs_by_fpr): Likewise. - -2009-07-22 Stef Walter - - * src/pkcs11.h: Make all constants UL that should be. - -2009-06-19 Werner Koch - - Release 1.3.0. - - * src/settings.h (SLOT_FIRMWARE_VERSION_MAJOR) - (SLOT_FIRMWARE_VERSION_MINOR, SLOT_HARDWARE_VERSION_MAJOR) - (SLOT_HARDWARE_VERSION_MINOR): Remove. - * src/p11-getslotinfo.c (CK_DEFINE_FUNCTION): Set firmware version - to Scute version and agent version to hardware version. - * src/agent.c (read_version_cb): New. - (agent_configure): Call that. - (agent_version_major, agent_version_minor): New. - (scute_agent_get_agent_version): New. - - * src/agent.c (SIG_LEN_2): Fix stupid c+p bug. - -2009-06-19 Marcus Brinkmann - - * src/Makefile.am (scute_deps): Add libgpg-error.a, libassuan.a. - (scute_libadd): New variable. - (libgpg-error.a, libassuan.a, clean-local): New targets. - (libscute_la_LIBADD): Add $(scute_libadd). - -2009-06-19 Werner Koch - - * src/agent.c (geteventcounter_status_cb): New. - (scute_agent_check_status): Check the eventcounter first. - -2009-06-19 Marcus Brinkmann - - * tests/t-getattribute.c (dump_object): Allow empty CKA_START_DATE - and CKA_END_DATE. - - * src/cert-object.c (scute_attr_prv): Always set CKA_START_DATE - and CKA_END_DATE. - -2009-06-19 Werner Koch - - * src/agent.c (MAX_SIGNATURE_LEN): Increase size to cope with 2048 - bit RSA. - (scute_agent_sign): Add a hack for 2048 bit RSA. - * tests/t-auth.c (sign_with_object): Increase SIZE to 256. - -2009-06-19 Marcus Brinkmann - - * libtool.m4: Removed. - * m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, - m4/lt~obsolete.m4: New files from libtool 2.2.6. - * configure.ac: Update to libtool 2.2.6. - (lt_cv_deplibs_check_method): Slightly evil hack to get libtool to - our thing. - (AC_DISABLE_STATIC, AC_LIBTOOL_WIN32_DLL, AC_LIBTOOL_RC) - (AC_PROG_LIBTOOL): Obsolete, replaced by ... - (LT_PREREQ, LT_INIT, LT_LANG): ... these new macro invocations. - * src/Makefile.am: Remove a bunch of rules for shared library. - (RCCOMPILE): New. - (LTRCCOMPILE): Use it here. - (.rc.lo): Add quoting. - -2009-06-19 Werner Koch - - * src/estream-printf.c, src/estream-printf.h: New. - * src/Makefile.am (sources): Add them. - * Makefile.am (SUBDIRS): Add m4/. - * m4/Makefile.am: New. - * m4/estream.m4: New. - * configure.ac (AC_REPLACE_FUNCS): Remove. - (estream_PRINTF_INIT): Add. - (AH_BOTTOM): Prefix estream fucntions. - (AC_FUNC_REALLOC) Remove because it uses AC_LIBOBJ which as - problems with the current libtool. The GNU guarantees for realloc - don't seem to be needed. - - * src/realloc.c: Remove - * src/vasprintf.c, src/stpcpy.c, src/stpcpy.h: Remove. - * src/support.h: Do not include stpcpy.h but define it inline. - Include estream-printf.h. - (vasprintf, asprintf, snprintf): Redefine to estream functions - - * src/agent.c (scute_agent_sign): s/sprintf/vsnprintf/. - -2009-06-18 Werner Koch - - * src/slots.c (slot_token_manufacturer): Update list. - -2009-04-23 Werner Koch - - * src/error-mapping.c (scute_gpg_err_to_ck): Add mappings to - CKR_PIN_INCORRECT and CKR_PIN_LOCKED. - -2008-12-03 Marcus Brinkmann - - * configure.ac: Enable AC_CONFIGU_MACRO_DIR. - * m4/ltsugar.m4, m4/libtool.m4, m4/ltversion.m4, - m4/lt~obsolete.m4, m4/ltoptions.m4: New files. - * config.guess, config.sub, ltmain.sh, configure.ac: Updated. - -2008-10-29 Marcus Brinkmann - - * configure.ac (_ASSUAN_ONLY_GPG_ERRORS): Define it. - * src/agent.c (default_inq_cb): Change return type to gpg_error_t - to silence gcc -W warning. - * src/cert-gpgsm.c (search_certs, export_cert_cb): Change type of - argument to silence gcc -W warning. - * src/p11-findobjects.c (CK_DEFINE_FUNCTION): Add explicit cast to - silence gcc -W warning. - * src/table.c (struct scute_table): Change signedness of - FIRST_FREE and LAST_USED members to silence gcc -W warning. - (scute_table_alloc): Change signedness of IDX for the same reason. - * tests/t-getslotinfo.c, tests/t-getsessioninfo.c, - tests/t-getmechanismlist.c, tests/t-auth.c, - tests/t-getattribute.c, tests/t-opensession.c, - tests/t-getslotlist.c, tests/t-getmechanisminfo.c, - tests/t-support.h, tests/t-closeallsessions.c, - tests/t-findobjects.c, tests/t-gettokeninfo.c: Change signedness - of some variables to silence gcc -W warnings. - -2008-10-21 Marcus Brinkmann - - * src/slots.c (slots_update_slot): Ignore card errors. - -2008-10-01 Marcus Brinkmann - - * src/agent.c (agent_connect): Set assuan log stream. - * src/p11-initialize.c: Include "debug.h". - (C_Initialize): Call _scute_debug_init. - * src/Makefile.am (sources): Add debug.c. - * src/debug.c: New file. - * src/debug.h: Rewritten. - * src/agent.c, src/cert-gpgsm.c, src/cert-object.c, - src/slots.c, src/error-mapping.c: More or improved or - adjusted debug output. - -2008-09-30 Marcus Brinkmann - - * src/cert-object.c [!CERT_PARSING]: Disable some certificate - parsing code. Unfortunately, we can't get rid of all of it for - now. - -2008-09-30 Marcus Brinkmann - - * src/get-path.c (find_program_in_inst_dir): New function. - (get_gpgsm_path, get_gpg_agent_path): Use it to check in install dir. - -2008-09-30 Werner Koch - - * src/Makefile.am (scute_DEPENDENCIES): Use .libs/versioninfo.o - - * AUTHORS (License): New. - - * Makefile.am (AUTOMAKE_OPTIONS): Do not distribute a gzip tarball. - (EXTRA_DIST): Distibute autogen.sh and README.SVN. - - * README.CVS: Replace by README.SVN. - - * configure.ac: Update bug address and some comments. - * autogen.sh: Update. - -2008-09-29 Marcus Brinkmann - - * src/gpgsm.c (struct search): New member WITH_CHAIN. - (search_cb): Only load chain if WITH_CHAIN is true. - (scute_gpgsm_get_cert): Call search_cb in the agent code path. - -2008-09-29 Marcus Brinkmann - - * src/slots.c (MIN): Remove macro. - (slot_token_maxpinlen, slot_token_pincount): Do not consider - second pincount, which meaning depends on the card version. - -2008-09-26 Marcus Brinkmann - - * src/agent.c: Include "cert.h". - (GET_CERT_INIT_SIZE): New symbol. - (struct get_cert_s): New struct. - (get_cert_data_cb, scute_agent_get_cert): New functions. - * src/gpgsm.c: Include "agent.h". - (scute_gpgsm_get_cert): Take extra argument NO. Use it to get the - certificate directly from the card, if possible. - * src/gpgsm.h (scute_gpgsm_get_cert): Add extra argument NO to - prototype. - * src/slots.c (slot_init): Pass extra argument to - scute_gpgsm_get_cert invocation. - * src/cert-object.c (scute_attr_prv, scute_attr_cert): Don't use - the fpr, timestamp and expire field of a certificate for now. - -2008-09-23 Marcus Brinkmann - - * src/agent.c (GET_CERT_INIT_SIZE): New symbol. - (struct get_cert_s): New struct. - (get_cert_data_cb, scute_agent_get_cert): New functions. - -2008-09-03 Marcus Brinkmann - - * src/Makefile.am (.rc.o): New rule. - - * src/Makefile.am (EXTRA_DIST): Add stpcpy.h. - -2008-09-02 Marcus Brinkmann - - * configure.ac: Post-release cleanup. - * doc/website/download.xhtml: Update. - -2008-09-02 Marcus Brinkmann - - * Released version 1.2.0. - - * doc/manual/Makefile.am (CLEANFILES): Add $(images_eps). - (images_eps): New variable. - (scute.dvi): Depend on $(images_eps) instead of $(images_pdf). - -2008-08-23 Marcus Brinkmann - - * src/Makefile.am [HAVE_W32_SYSTEM]: Build autonomous DLL. - -2008-08-23 Marcus Brinkmann - - * src/agent.c (gnupg_allow_set_foregound_window) - [!HAVE_W32_SYSTEM]: Define it. - -2008-08-23 Marcus Brinkmann - - * src/Makefile.am [HAVE_W32_SYSTEM]: Build autonomous DLL. - * src/dllmain.c (DllMain): New file. - * src/cert-gpgsm.c: Include "debug.h". Use - assuan_pipe_connect_ext instead of assuan_pipe_connect everywhere. - * src/agent.c (WINVER) [HAVE_W32_SYSTEM]: Define symbol. - [HAVE_W32_SYSTEM]: Include . Do this before including - . - (gnupg_allow_set_foregound_window): New function. - (agent_connect): Use Sleep() instead of _sleep(). - (default_inq_cb): New function, and use it in all transactions. - (agent_configure): Don't bail out if ttytname is not defined. Set - allow-pinentry-notify. - * tests/t-support.h [_WIN32]: Include . - (init_cryptoki) [_WIN32]: Call WSAStartup. - -2008-08-21 Marcus Brinkmann - - * src/scute.def: Start at @1 instead of @0. - -2008-08-21 Marcus Brinkmann - - * src/agent.c (agent_configure): Fix cut and paste error. - -2008-08-11 Marcus Brinkmann - - * src/agent.c (spawn_process_detachted) [! HAVE_W32_SYSTEM]: Remove. - (agent_configure): Ignore error with old versions of gpg-agent. - -2008-08-08 Marcus Brinkmann - - * configure.ac: Update svn macros. - (BUILD_REVISION, BUILD_FILEVERSION, BUILD_TIMESTAMP): New. - (AC_CONFIG_OUTPUT): Add src/versioninfo.rc. - (GPG_AGENT_DEFAULT, GPG_AGENT): New. - (AC_REPLACE_FUNCS): Add vasprintf and stpcpy. - (AC_CHECK_FUNCS): Add ttyname, localtime_r and timegm. - * src/stpcpy.h, src/stpcpy.c, src/realloc.c: New file from gnulib. - * src/vasprintf.c: New file from libiberty. - * src/support.h [!HAVE_STPCPY]: Include "stpcpy.h". - [!HAVE_TTYNAME]: Define simple replacement function. - (get_gpgsm_path, get_gpg_agent_path) - (default_homedir, make_filename): New prototypes. - * src/Makefile.am: Add W32 support. - (libscute_la_SOURCES): Add get-path.c. - (EXTRA_DIST): Add versioninfo.rc.in. - * src/versioninfo.rc.in: New file. - * src/get-path.c: New file. - * src/agent.c (PATHSEP_C): New macro. - (build_w32_commandline_copy) - (build_w32_commandline) [HAVE_W32_SYSTEM]: New functions. - (spawn_process_deatched): New function. - (agent_connect): Start gpg-agent if it is not running yet. - (agent_configure): Also pass xauthority and pinentry-user-data. - * src/cert-gpgsm.c (COMPAT_FALLBACK) [!HAVE_W32_SYSTEM]: New - macro. - (export_cert_compat) [!COMPAT_FALLBACK]: Remove. - (export_cert) [!COMPAT_FALLBACK]: Don't call export_cert_compat. - Don't create (unused) output pipe cruft. - * src/cert-object.c (time_to_ck_date) [!HAVE_LOCALTIME_R]: Fall - back to localtime. - * tests/t-getslotinfo.c (main) [WIN32]: Call _sleep instead sleep. - - * src/cryptoki.h (CRYPTOKI_EXPORTS): Define symbol. - * src/error-mapping.h: Do not include . - (scute_sys_to_ck): Change type of ERR to int. - * src/error-mapping.c: Do not include . - (scute_sys_to_ck): Change type of ERR to int. - * src/slots.c (slot_create_session): Change type of ERR to int. - -2007-05-03 Marcus Brinkmann - - Released version 1.1.0. - - * doc/manual/Makefile.am (images_pdf, CLEANFILES): New variables. - (scute.dvi, scute.pdf): New dependencies. - (%.eps, %.pdf): New rules. - * configure.ac: Check for convert and epstopdf. - - * doc/manual/scute.texi (Authentication With Service): Avoid - @indicateurl in TeX output, as this seems to be broken (in - texi2dvi 1.34). - - * doc/manual/Makefile.am (images, EXTRA_DIST): New variables. - -2007-04-30 Marcus Brinkmann - - * src/agent.h (scute_agent_is_trusted): New prototype. Include - . - * src/agent.c (scute_agent_is_trusted): New implementation. - * src/cert.h (struct cert): New member IS_TRUSTED. - * src/cert-gpgsm.c (export_cert): Set CERT->is_trusted. - * src/cert-object.c (scute_attr_cert): Set CKA_TRUSTED to - CERT->is_trusted. - * tests/t-getattribute.c: Support new option '--printable'. - - * src/table.c (scute_table_dealloc): Return, but not a value. - -2007-02-09 Marcus Brinkmann - - * src/pkcs11.h: Add definitions for SHA. - -2006-12-17 Marcus Brinkmann - - * src/pkcs11.h: Minor cosmetic changes. Require CRYPTOKI_GNU now - to switch on the GNU API, and do not check what CRYPTOKI_COMPAT is - defined to, just if it is defined at all. - - * src/pkcs11.h [__WIN32]: Changed to [_WIN32 || - CRYPTOKI_FORCE_WIN32] at the end. - Submitted by Alon Bar-Lev. - -2006-12-11 Marcus Brinkmann - - * src/pkcs11.h (CKO_VENDOR_DEFINED): Fixed syntax error. - -2006-12-10 Marcus Brinkmann - - * configure.ac (NEED_GPG_ERROR_VERSION): Bump to 1.4. - - * src/pkcs11.h [CRYPTOKI_COMPAT]: Rewrote the compatibility layer. - -2006-12-09 Marcus Brinkmann - - * src/pkcs11.h [__cplusplus]: Protect with extern "C". - Do not use the C++ keyword "template" in parameter lists. - Submitted by Alon Bar-Lev. - - * src/pkcs11.h [__WIN32]: Changed to [_WIN32 || - CRYPTOKI_FORCE_WIN32]. - (ck_rv_t): Changed to unsigned long. - (CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR, - CRYPTOKI_VERSION_REVISION): New macros. - (CKO_VENDOR_DEFINED, CKH_VENDOR_DEFINED, CKK_VENDOR_DEFINED, - CKC_VENDOR_DEFINED, CKA_VENDOR_DEFINED, CKM_VENDOR_DEFINED, - CKF_EXTENSION, CKR_VENDOR_DEFINED): Add cast to suppress compiler - warning. - Submitted by Alon Bar-Lev. - - * src/cryptoki.h (CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR): - Removed. - -2006-11-30 Marcus Brinkmann - - * m4/autobuild.m4: New file. - * configure.ac: Invoke AB_INIT. - -2006-11-29 Marcus Brinkmann - - * configure.ac (CFLAGS): Remove variable. - -2006-11-27 Marcus Brinkmann - - * src/pkcs11.h: Add more definitions provided by Andreas Jellinghaus. - - * README (Copyright and License): Update copyright notice. Also - for all other files. - * AUTHORS (Maintainer): Removed RSA Security Inc. - * include/pkcs11t.h, include/pkcs11f.h, include/pkcs11.h, - include/disclaimer.txt, include/cryptoki-w32.h, - include/cryptoki-generic.h, include/README, include/Makefile.am: - Files removed. - * configure.ac (AC_CONFIG_FILES): Removed include/Makefile. - * Makefile.am (SUBDIRS): Removed include directory. - -2006-11-24 Marcus Brinkmann - - * src/pkcs11.h: New file. - * src/Makefile.am (libscute_la_SOURCES): Add pkcs11.h. - * src/cryptoki.h: Include "pkcs11.h" instead of original PKCS #11 - header file. - * tests/t-support.h (mechanism_type_str): Remove most mechanisms. - -2006-11-23 Marcus Brinkmann - - * src/cert-gpgsm.c (search_certs_line): Don't overwrite CERT->uid. - -2006-11-21 Marcus Brinkmann - - * src/cert-gpgsm.c (search_certs_line): Fix off-by-one error. - (export_cert_cb): Fix bug if EXP->buffer_size is 0. - - * src/cert-gpgsm.c (cert_reset): Free CERT->cert_der if set. - (export_cert): Reimplement using data channel. - (export_cert_compat): This contains the old version for - compatibility. - * src/cert.h (MAX_CERT_SIZE): Macro removed. - (struct cert): Changed member CERT_DER into a pointer. - - * configure.ac (AC_CONFIG_FILES): Add doc/manual/Makefile. - * doc/Makefile.am (SUBDIRS): New variable. - * doc/manual/Makefile, doc/manual/scute.texi, doc/manual/gpl.texi, - doc/manual/mdate-sh, doc/manual/texinfo.tex, - doc/manual/firefox-cm.png, doc/manual/firefox-cm-view-detail.png, - doc/manual/firefox-cm-view.png, - doc/manual/firefox-dm-load-after.png, - doc/manual/firefox-dm-load-before.png, - doc/manual/firefox-dm-load.png, - doc/manual/firefox-dm-token-present.png, - doc/manual/firefox-pref.png, doc/manual/firefox-pref-view.png: New - files. - -2006-11-11 Marcus Brinkmann - - * Released version 1.0.0. - -2006-11-11 Marcus Brinkmann - - * src/error-mapping.c (scute_gpg_err_to_ck): Report error on debug - stream. - * src/slots.c (add_object): New function. - (slot_init): Rewritten using add_object. - * src/gpgsm.c: Include "gpgsm.h". - (struct search): Replace members ATTRP, ATTR_COUNTP, PRV_ATTRP, - PRV_ATTR_COUNTP by CERT_GET_CB, HOOK. - (search_cb): Rewritten to add all certificates for a certain key - (scute_gpgsm_get_cert): Take a callback function instead of - attribute pointers. - * gpgsm.h (scute_gpgsm_get_cert): Adjust prototype. - and also the certificate chain. - * src/cert.h (scute_gpgsm_search_certs_by_fpr): New prototype. - (struct cert): New member chain_id. - * src/cert-gpgsm.c (struct search_ctx_by_grip): Rename to ... - (struct search_ctx): ... this. Rename field GRIP to PATTERN, and - add new field FIELD. - (search_certs_by_grip): Rename function to ... - (search_certs): ... this. - (scute_gpgsm_search_certs_by_fpr): Change user of the above. - (scute_gpgsm_search_certs_by_fpr): New function. - (search_certs_line): Store chain ID. - -2006-11-07 Marcus Brinkmann - - * src/p11-gettokeninfo.c (C_GetTokenInfo): Fix assignment. - -2006-11-06 Marcus Brinkmann - - * doc/website/format/web.css: Set margin to 0. - - * configure.ac (AC_CONFIG_FILES): Add doc/Makefile. - Makefile.am (SUBDIRS): Add doc/. - doc/, doc/website/, doc/website/format: New directories. - doc/Makefile.am, doc/website/index.xhtml, - doc/website/documentation.xhtml, doc/website/download.xhtml, - doc/website/contact.xhtml, doc/website/format/web.css, - doc/website/format/scute-logo.svg, - doc/website/format/scute-border.jpg: New files. - -2006-10-30 Marcus Brinkmann - - * configure.ac (PACKAGE, VERSION): Define these variables. - * src/Makefile.am (libscute_la_CPPFLAGS): Fix include path for - VPATH builds. - - * configure.ac (VERSION_MAJOR, VERSION_MINOR): New variable - definitions. - * src/gpgsm.h: Fix syntax error. - * src/table.c, src/table.h: Rewritten. - * src/slots.c: Reorganized and rewritten to use the new table - interface. Include gpgsm.h. - * src/p11-signinit.c, src/p11-sign.c, src/p11-getslotlist.c, - src/p11-getsessioninfo.c, src/p11-getmechanismlist.c, - src/p11-getattributevalue.c, src/p11-findobjectsinit.c, - src/p11-findobjectsfinal.c, src/p11-findobjects.c, - src/p11-closesession.c: Adjust callers. - -2006-10-26 Marcus Brinkmann - - * src/settings.h: Require VERSION_MAJOR and VERSION_MINOR to be - defined. - - * src/p11-getinfo.c (CRYPTOKI_VERSION_MAJOR, - CRYPTOKI_VERSION_MINOR): Move macros to ... - * src/cryptoki.h (CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR): - ... here - - * src/gpgsm.c (gpgsm_get_cert): Rename to ... - (scute_gpgsm_get_cert): ... this. - * src/gpgsm.h: New file. - * src/Makefile.am (libscute_la_SOURCES): Add gpgsm.h. - * src/slots.c (gpgsm_get_cert): Remove prototype. - (slots_update_slot): Call scute_gpgsm_get_cert, not gpgsm_get_cert. - - * src/error-mapping.c (scute_gpg_err_to_ck): Map GPG_ERR_NO_AGENT - to CKR_GENERAL_ERROR. - * src/agent.h (struct agent_card_info_s): Remove member error. - Prefix external functions with scute_ if not already done so, also - for callers. - * src/agent.c: Include . Replace one-letter variable - names by proper ones. Replace assuan_error_t with gpg_error_t - everywhere. - (agent_connect, agent_simple_cmd, agent_configure): New functions. - (scute_agent_initialize): Use these new functions. - ing of common code. Lots of cleanups. - (scute_agent_finalize): Clear agent_ctx. Add debug message. - -2006-10-13 Werner Koch - - * src/cert-gpgsm.c (MAX_LINE_LEN): Increased. - - * src/locking.c: Include string.h for memset declaration. - - * configure.ac: New option --disable-optimization. - -2006-08-02 Marcus Brinkmann - - * Initial version. - - - Copyright 2006, 2007, 2008 g10 Code GmbH - - This file is free software; as a special exception the author gives - unlimited permission to copy and/or distribute it, with or without - modifications, as long as this notice is preserved. - - This file is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY, to the extent permitted by law; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Dummy ChangeLog - the old one is build-aus/git-log-footer diff --git a/Makefile.am b/Makefile.am index 808a956..0054d99 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,33 +1,63 @@ # Makefile.am - Top level Makefile for scute. # Copyright (C) 2006 g10 Code GmbH # # This file is part of Scute. # # Scute is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # Scute is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, see . # SPDX-License-Identifier: LGPL-2.1-or-later ## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip -EXTRA_DIST = autogen.sh README.GIT +EXTRA_DIST = autogen.sh README.GIT VERSION if RUN_TESTS tests = tests else tests = endif SUBDIRS = m4 src ${tests} doc + +dist-hook: gen-ChangeLog + +distcheck-hook: + set -e; ( \ + pref="#+macro: scute_" ;\ + reldate="$$(date -u +%Y-%m-%d)" ;\ + echo "$${pref}ver $(PACKAGE_VERSION)" ;\ + echo "$${pref}date $${reldate}" ;\ + list='$(DIST_ARCHIVES)'; for i in $$list; do \ + case "$$i" in *.tar.bz2) \ + echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\ + echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\ + echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\ + esac;\ + done ) | tee $(distdir).swdb + +.PHONY: gen-ChangeLog release sign-release + +gen_start_date = 2011-12-01T00:00:00 +gen-ChangeLog: + if test -d $(top_srcdir)/.git; then \ + (cd $(top_srcdir) && \ + $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \ + --amend=build-aux/git-log-fix \ + --since=$(gen_start_date) ) > $(distdir)/cl-t; \ + cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\ + rm -f $(distdir)/ChangeLog; \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; \ + fi diff --git a/autogen.sh b/autogen.sh index 10cc203..1c6e428 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,469 +1,518 @@ #! /bin/sh # autogen.sh -# Copyright (C) 2003, 2014 g10 Code GmbH +# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # This is a generic script to create the configure script and handle cross # build environments. It requires the presence of a autogen.rc file to # configure it for the respective package. It is maintained as part of # GnuPG and source copied by other packages. # -# Version: 2014-06-06 +# Version: 2018-07-10 configure_ac="configure.ac" cvtver () { awk 'NR==1 {split($NF,A,".");X=1000000*A[1]+1000*A[2]+A[3];print X;exit 0}' } check_version () { if [ $(( `("$1" --version || echo "0") | cvtver` >= $2 )) = 1 ]; then return 0 fi echo "**Error**: "\`$1\'" not installed or too old." >&2 echo ' Version '$3' or newer is required.' >&2 [ -n "$4" ] && echo ' Note that this is part of '\`$4\''.' >&2 DIE="yes" return 1 } fatal () { echo "autogen.sh:" "$*" >&2 DIE=yes } info () { if [ -z "${SILENT}" ]; then echo "autogen.sh:" "$*" >&2 fi } die_p () { if [ "$DIE" = "yes" ]; then echo "autogen.sh: Stop." >&2 exit 1 fi } replace_sysroot () { configure_opts=$(echo $configure_opts | sed "s#@SYSROOT@#${w32root}#g") extraoptions=$(echo $extraoptions | sed "s#@SYSROOT@#${w32root}#g") } # Allow to override the default tool names AUTOCONF=${AUTOCONF_PREFIX}${AUTOCONF:-autoconf}${AUTOCONF_SUFFIX} AUTOHEADER=${AUTOCONF_PREFIX}${AUTOHEADER:-autoheader}${AUTOCONF_SUFFIX} AUTOMAKE=${AUTOMAKE_PREFIX}${AUTOMAKE:-automake}${AUTOMAKE_SUFFIX} ACLOCAL=${AUTOMAKE_PREFIX}${ACLOCAL:-aclocal}${AUTOMAKE_SUFFIX} GETTEXT=${GETTEXT_PREFIX}${GETTEXT:-gettext}${GETTEXT_SUFFIX} MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX} DIE=no FORCE= SILENT= PRINT_HOST=no PRINT_BUILD=no tmp=$(dirname "$0") tsdir=$(cd "${tmp}"; pwd) -version_parts=3 if [ -n "${AUTOGEN_SH_SILENT}" ]; then SILENT=" --silent" fi if test x"$1" = x"--help"; then - echo "usage: ./autogen.sh [--silent] [--force] [--build-TYPE] [ARGS]" + echo "usage: ./autogen.sh [OPTIONS] [ARGS]" + echo " Options:" + echo " --silent Silent operation" + echo " --force Pass --force to autoconf" + echo " --find-version Helper for configure.ac" + echo " --git-build Run all commands to build from a Git" + echo " --print-host Print only the host triplet" + echo " --print-build Print only the build platform triplet" + echo " --build-TYPE Configure to cross build for TYPE" + echo "" + echo " ARGS are passed to configure in --build-TYPE mode." + echo " Configuration for this script is expected in autogen.rc" exit 0 fi if test x"$1" = x"--silent"; then SILENT=" --silent" shift fi if test x"$1" = x"--force"; then FORCE=" --force" shift fi if test x"$1" = x"--print-host"; then PRINT_HOST=yes shift fi if test x"$1" = x"--print-build"; then PRINT_BUILD=yes shift fi # Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces # as unsafe because it is too easy to get scripts wrong in this regard. am_lf=' ' case `pwd` in *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) fatal "unsafe working directory name" ;; esac case $tsdir in *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) fatal "unsafe source directory: \`$tsdir'" ;; esac case $HOME in *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) fatal "unsafe home directory: \`$HOME'" ;; esac die_p # List of variables sourced from autogen.rc. The strings '@SYSROOT@' in # these variables are replaced by the actual system root. configure_opts= extraoptions= # List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc w32_toolprefixes= w32_extraoptions= w32ce_toolprefixes= w32ce_extraoptions= w64_toolprefixes= w64_extraoptions= amd64_toolprefixes= # End list of optional variables sourced from ~/.gnupg-autogen.rc # What follows are variables which are sourced but default to # environment variables or lacking them hardcoded values. #w32root= #w32ce_root= #w64root= #amd64root= # Convenience option to use certain configure options for some hosts. myhost="" myhostsub="" case "$1" in --find-version) myhost="find-version" SILENT=" --silent" shift ;; + --git-build) + myhost="git-build" + shift + ;; --build-w32) myhost="w32" shift ;; --build-w32ce) myhost="w32" myhostsub="ce" shift ;; --build-w64) myhost="w32" myhostsub="64" shift ;; --build-amd64) myhost="amd64" shift ;; --build*) fatal "**Error**: invalid build option $1" shift ;; *) ;; esac die_p +# **** GIT BUILD **** +# This is a helper to build from git. +if [ "$myhost" = "git-build" ]; then + tmp="$(pwd)" + cd "$tsdir" || fatal "error cd-ing to $tsdir" + ./autogen.sh || fatal "error running ./autogen.sh" + cd "$tmp" || fatal "error cd-ing back to $tmp" + die_p + "$tsdir"/configure || fatal "error running $tsdir/configure" + die_p + make || fatal "error running make" + die_p + make check || fatal "error running male check" + die_p + exit 0 +fi +# **** end GIT BUILD **** + + # Source our configuration if [ -f "${tsdir}/autogen.rc" ]; then . "${tsdir}/autogen.rc" fi # Source optional site specific configuration if [ -f "$HOME/.gnupg-autogen.rc" ]; then info "sourcing extra definitions from $HOME/.gnupg-autogen.rc" . "$HOME/.gnupg-autogen.rc" fi # **** FIND VERSION **** # This is a helper for the configure.ac M4 magic # Called # ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO] # returns a complete version string with automatic beta numbering. if [ "$myhost" = "find-version" ]; then package="$1" major="$2" minor="$3" micro="$4" - case "$version_parts" in - 2) - matchstr1="$package-$major.[0-9]*" - matchstr2="$package-$major-base" - vers="$major.$minor" - ;; - *) - matchstr1="$package-$major.$minor.[0-9]*" - matchstr2="$package-$major.$minor-base" - vers="$major.$minor.$micro" - ;; - esac + if [ -z "$package" -o -z "$major" -o -z "$minor" ]; then + echo "usage: ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]" >&2 + exit 1 + fi + + if [ -z "$micro" ]; then + matchstr1="$package-$major.[0-9]*" + matchstr2="$package-$major-base" + vers="$major.$minor" + else + matchstr1="$package-$major.$minor.[0-9]*" + matchstr2="$package-$major.$minor-base" + vers="$major.$minor.$micro" + fi beta=no if [ -e .git ]; then ingit=yes tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null) + tmp=$(echo "$tmp" | sed s/^"$package"//) if [ -n "$tmp" ]; then - tmp=$(echo "$tmp"|awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}') + tmp=$(echo "$tmp" | sed s/^"$package"// \ + | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}') else tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \ - | awk -F- '$4!=0{print"-beta"$4}') + | awk -F- '$4!=0{print"-beta"$4}') + if [ -z "$tmp" ]; then + tmp=$(git describe --match "${package}-default-base" \ + --long 2>/dev/null | awk -F- '$4!=0{print"-beta"$4}') + fi + fi [ -n "$tmp" ] && beta=yes rev=$(git rev-parse --short HEAD | tr -d '\n\r') - rvd=$((0x$(echo ${rev} | head -c 4))) + rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) else ingit=no beta=yes tmp="-unknown" rev="0000000" rvd="0" fi echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:" exit 0 fi # **** end FIND VERSION **** if [ ! -f "$tsdir/build-aux/config.guess" ]; then fatal "$tsdir/build-aux/config.guess not found" exit 1 fi build=`$tsdir/build-aux/config.guess` if [ $PRINT_BUILD = yes ]; then echo "$build" exit 0 fi # ****************** # W32 build script # ****************** if [ "$myhost" = "w32" ]; then case $myhostsub in ce) w32root="$w32ce_root" [ -z "$w32root" ] && w32root="$HOME/w32ce_root" toolprefixes="$w32ce_toolprefixes arm-mingw32ce" extraoptions="$extraoptions $w32ce_extraoptions" ;; 64) w32root="$w64root" [ -z "$w32root" ] && w32root="$HOME/w64root" toolprefixes="$w64_toolprefixes x86_64-w64-mingw32" extraoptions="$extraoptions $w64_extraoptions" ;; *) [ -z "$w32root" ] && w32root="$HOME/w32root" toolprefixes="$w32_toolprefixes i686-w64-mingw32 i586-mingw32msvc" toolprefixes="$toolprefixes i386-mingw32msvc mingw32" extraoptions="$extraoptions $w32_extraoptions" ;; esac info "Using $w32root as standard install directory" replace_sysroot # Locate the cross compiler crossbindir= for host in $toolprefixes; do if ${host}-gcc --version >/dev/null 2>&1 ; then crossbindir=/usr/${host}/bin conf_CC="CC=${host}-gcc" break; fi done if [ -z "$crossbindir" ]; then fatal "cross compiler kit not installed" if [ -z "$myhostsub" ]; then info "Under Debian GNU/Linux, you may install it using" info " apt-get install mingw32 mingw32-runtime mingw32-binutils" fi die_p fi if [ $PRINT_HOST = yes ]; then echo "$host" exit 0 fi if [ -f "$tsdir/config.log" ]; then if ! head $tsdir/config.log | grep "$host" >/dev/null; then fatal "Please run a 'make distclean' first" die_p fi fi $tsdir/configure --enable-maintainer-mode ${SILENT} \ --prefix=${w32root} \ --host=${host} --build=${build} SYSROOT=${w32root} \ - PKG_CONFIG_LIBDIR=${w32root} \ + PKG_CONFIG_LIBDIR=${w32root}/lib/pkgconfig \ ${configure_opts} ${extraoptions} "$@" rc=$? exit $rc fi # ***** end W32 build script ******* # ***** AMD64 cross build script ******* # Used to cross-compile for AMD64 (for testing) if [ "$myhost" = "amd64" ]; then [ -z "$amd64root" ] && amd64root="$HOME/amd64root" info "Using $amd64root as standard install directory" replace_sysroot toolprefixes="$amd64_toolprefixes x86_64-linux-gnu amd64-linux-gnu" # Locate the cross compiler crossbindir= for host in $toolprefixes ; do if ${host}-gcc --version >/dev/null 2>&1 ; then crossbindir=/usr/${host}/bin conf_CC="CC=${host}-gcc" break; fi done if [ -z "$crossbindir" ]; then echo "Cross compiler kit not installed" >&2 echo "Stop." >&2 exit 1 fi if [ $PRINT_HOST = yes ]; then echo "$host" exit 0 fi if [ -f "$tsdir/config.log" ]; then if ! head $tsdir/config.log | grep "$host" >/dev/null; then echo "Please run a 'make distclean' first" >&2 exit 1 fi fi $tsdir/configure --enable-maintainer-mode ${SILENT} \ --prefix=${amd64root} \ --host=${host} --build=${build} \ ${configure_opts} ${extraoptions} "$@" rc=$? exit $rc fi # ***** end AMD64 cross build script ******* # Grep the required versions from configure.ac autoconf_vers=`sed -n '/^AC_PREREQ(/ { s/^.*(\(.*\))/\1/p q }' ${configure_ac}` autoconf_vers_num=`echo "$autoconf_vers" | cvtver` automake_vers=`sed -n '/^min_automake_version=/ { s/^.*="\(.*\)"/\1/p q }' ${configure_ac}` automake_vers_num=`echo "$automake_vers" | cvtver` if [ -d "${tsdir}/po" ]; then gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ { s/^.*\[\(.*\)])/\1/p q }' ${configure_ac}` gettext_vers_num=`echo "$gettext_vers" | cvtver` else gettext_vers="n/a" fi if [ -z "$autoconf_vers" -o -z "$automake_vers" -o -z "$gettext_vers" ] then echo "**Error**: version information not found in "\`${configure_ac}\'"." >&2 exit 1 fi if check_version $AUTOCONF $autoconf_vers_num $autoconf_vers ; then check_version $AUTOHEADER $autoconf_vers_num $autoconf_vers autoconf fi if check_version $AUTOMAKE $automake_vers_num $automake_vers; then check_version $ACLOCAL $automake_vers_num $autoconf_vers automake fi if [ "$gettext_vers" != "n/a" ]; then if check_version $GETTEXT $gettext_vers_num $gettext_vers; then check_version $MSGMERGE $gettext_vers_num $gettext_vers gettext fi fi if [ "$DIE" = "yes" ]; then cat </dev/null 2>/dev/null; then + [ -z "${SILENT}" ] && CP="$CP -v" + fi if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then [ -z "${SILENT}" ] && cat < Release 1.4.0. * configure.ac (NEED_LIBASSUAN_VERSION): Bump to 2.0.0. (LIBSCUTE_LT_REVISION): Bump to 2. 2009-12-08 Marcus Brinkmann * src/agent.c (agent_connect): Convert posix fd to assuan fd. * src/cert-gpgsm.c (export_cert_compat): Likewise. * src/Makefile.am (libgpg-error.a, libassuan.a): Force symlink. 2009-11-06 Marcus Brinkmann * src/cert-gpgsm.c (export_cert_compat, export_cert) (scute_gpgsm_search_certs_by_grip) (scute_gpgsm_search_certs_by_fpr): Call assuan_pipe_connect instead of assuan_pipe_connect_ext. * src/agent.c (agent_connect): Update use of assuan_socket_connect and assuan_pipe_connect. 2009-10-16 Marcus Brinkmann * src/p11-initialize.c (CK_DEFINE_FUNCTION): Fix code on non-Windows. 2009-10-08 Marcus Brinkmann * src/p11-initialize.c (C_Initialize): Call WSAStartup. * src/p11-finalize.c (CK_DEFINE_FUNCTION): Call WSACleanup. 2009-10-06 Marcus Brinkmann * src/pkcs11.h: Add support for GOST. By Andreas Jellinghaus. 2009-09-23 Marcus Brinkmann * configure.ac (NEED_LIBASSUAN_VERSION): Update to 1.1.0. (_ASSUAN_ONLY_GPG_ERROR): Remove. * src/p11-initialize.c: Update to new Assuan interface. * src/debug.c (_scute_debug_init): Remove call to assuan_set_assuan_log_stream. * src/agent.c (agent_connect): Allocate assuan context before connecting to server. Release it on error. * src/cert-gpgsm.c (export_cert_compat, export_cert) (scute_gpgsm_search_certs_by_grip) (scute_gpgsm_search_certs_by_fpr): Likewise. 2009-07-22 Stef Walter * src/pkcs11.h: Make all constants UL that should be. 2009-06-19 Werner Koch Release 1.3.0. * src/settings.h (SLOT_FIRMWARE_VERSION_MAJOR) (SLOT_FIRMWARE_VERSION_MINOR, SLOT_HARDWARE_VERSION_MAJOR) (SLOT_HARDWARE_VERSION_MINOR): Remove. * src/p11-getslotinfo.c (CK_DEFINE_FUNCTION): Set firmware version to Scute version and agent version to hardware version. * src/agent.c (read_version_cb): New. (agent_configure): Call that. (agent_version_major, agent_version_minor): New. (scute_agent_get_agent_version): New. * src/agent.c (SIG_LEN_2): Fix stupid c+p bug. 2009-06-19 Marcus Brinkmann * src/Makefile.am (scute_deps): Add libgpg-error.a, libassuan.a. (scute_libadd): New variable. (libgpg-error.a, libassuan.a, clean-local): New targets. (libscute_la_LIBADD): Add $(scute_libadd). 2009-06-19 Werner Koch * src/agent.c (geteventcounter_status_cb): New. (scute_agent_check_status): Check the eventcounter first. 2009-06-19 Marcus Brinkmann * tests/t-getattribute.c (dump_object): Allow empty CKA_START_DATE and CKA_END_DATE. * src/cert-object.c (scute_attr_prv): Always set CKA_START_DATE and CKA_END_DATE. 2009-06-19 Werner Koch * src/agent.c (MAX_SIGNATURE_LEN): Increase size to cope with 2048 bit RSA. (scute_agent_sign): Add a hack for 2048 bit RSA. * tests/t-auth.c (sign_with_object): Increase SIZE to 256. 2009-06-19 Marcus Brinkmann * libtool.m4: Removed. * m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4: New files from libtool 2.2.6. * configure.ac: Update to libtool 2.2.6. (lt_cv_deplibs_check_method): Slightly evil hack to get libtool to our thing. (AC_DISABLE_STATIC, AC_LIBTOOL_WIN32_DLL, AC_LIBTOOL_RC) (AC_PROG_LIBTOOL): Obsolete, replaced by ... (LT_PREREQ, LT_INIT, LT_LANG): ... these new macro invocations. * src/Makefile.am: Remove a bunch of rules for shared library. (RCCOMPILE): New. (LTRCCOMPILE): Use it here. (.rc.lo): Add quoting. 2009-06-19 Werner Koch * src/estream-printf.c, src/estream-printf.h: New. * src/Makefile.am (sources): Add them. * Makefile.am (SUBDIRS): Add m4/. * m4/Makefile.am: New. * m4/estream.m4: New. * configure.ac (AC_REPLACE_FUNCS): Remove. (estream_PRINTF_INIT): Add. (AH_BOTTOM): Prefix estream fucntions. (AC_FUNC_REALLOC) Remove because it uses AC_LIBOBJ which as problems with the current libtool. The GNU guarantees for realloc don't seem to be needed. * src/realloc.c: Remove * src/vasprintf.c, src/stpcpy.c, src/stpcpy.h: Remove. * src/support.h: Do not include stpcpy.h but define it inline. Include estream-printf.h. (vasprintf, asprintf, snprintf): Redefine to estream functions - + * src/agent.c (scute_agent_sign): s/sprintf/vsnprintf/. 2009-06-18 Werner Koch * src/slots.c (slot_token_manufacturer): Update list. 2009-04-23 Werner Koch * src/error-mapping.c (scute_gpg_err_to_ck): Add mappings to CKR_PIN_INCORRECT and CKR_PIN_LOCKED. 2008-12-03 Marcus Brinkmann * configure.ac: Enable AC_CONFIGU_MACRO_DIR. * m4/ltsugar.m4, m4/libtool.m4, m4/ltversion.m4, m4/lt~obsolete.m4, m4/ltoptions.m4: New files. * config.guess, config.sub, ltmain.sh, configure.ac: Updated. 2008-10-29 Marcus Brinkmann * configure.ac (_ASSUAN_ONLY_GPG_ERRORS): Define it. * src/agent.c (default_inq_cb): Change return type to gpg_error_t to silence gcc -W warning. * src/cert-gpgsm.c (search_certs, export_cert_cb): Change type of argument to silence gcc -W warning. * src/p11-findobjects.c (CK_DEFINE_FUNCTION): Add explicit cast to silence gcc -W warning. * src/table.c (struct scute_table): Change signedness of FIRST_FREE and LAST_USED members to silence gcc -W warning. (scute_table_alloc): Change signedness of IDX for the same reason. * tests/t-getslotinfo.c, tests/t-getsessioninfo.c, tests/t-getmechanismlist.c, tests/t-auth.c, tests/t-getattribute.c, tests/t-opensession.c, tests/t-getslotlist.c, tests/t-getmechanisminfo.c, tests/t-support.h, tests/t-closeallsessions.c, tests/t-findobjects.c, tests/t-gettokeninfo.c: Change signedness of some variables to silence gcc -W warnings. 2008-10-21 Marcus Brinkmann * src/slots.c (slots_update_slot): Ignore card errors. 2008-10-01 Marcus Brinkmann * src/agent.c (agent_connect): Set assuan log stream. * src/p11-initialize.c: Include "debug.h". (C_Initialize): Call _scute_debug_init. * src/Makefile.am (sources): Add debug.c. * src/debug.c: New file. * src/debug.h: Rewritten. * src/agent.c, src/cert-gpgsm.c, src/cert-object.c, src/slots.c, src/error-mapping.c: More or improved or adjusted debug output. 2008-09-30 Marcus Brinkmann * src/cert-object.c [!CERT_PARSING]: Disable some certificate parsing code. Unfortunately, we can't get rid of all of it for now. 2008-09-30 Marcus Brinkmann * src/get-path.c (find_program_in_inst_dir): New function. (get_gpgsm_path, get_gpg_agent_path): Use it to check in install dir. 2008-09-30 Werner Koch * src/Makefile.am (scute_DEPENDENCIES): Use .libs/versioninfo.o * AUTHORS (License): New. * Makefile.am (AUTOMAKE_OPTIONS): Do not distribute a gzip tarball. (EXTRA_DIST): Distibute autogen.sh and README.SVN. * README.CVS: Replace by README.SVN. * configure.ac: Update bug address and some comments. * autogen.sh: Update. 2008-09-29 Marcus Brinkmann * src/gpgsm.c (struct search): New member WITH_CHAIN. (search_cb): Only load chain if WITH_CHAIN is true. (scute_gpgsm_get_cert): Call search_cb in the agent code path. 2008-09-29 Marcus Brinkmann * src/slots.c (MIN): Remove macro. (slot_token_maxpinlen, slot_token_pincount): Do not consider second pincount, which meaning depends on the card version. 2008-09-26 Marcus Brinkmann * src/agent.c: Include "cert.h". (GET_CERT_INIT_SIZE): New symbol. (struct get_cert_s): New struct. (get_cert_data_cb, scute_agent_get_cert): New functions. * src/gpgsm.c: Include "agent.h". (scute_gpgsm_get_cert): Take extra argument NO. Use it to get the certificate directly from the card, if possible. * src/gpgsm.h (scute_gpgsm_get_cert): Add extra argument NO to prototype. * src/slots.c (slot_init): Pass extra argument to scute_gpgsm_get_cert invocation. * src/cert-object.c (scute_attr_prv, scute_attr_cert): Don't use the fpr, timestamp and expire field of a certificate for now. 2008-09-23 Marcus Brinkmann * src/agent.c (GET_CERT_INIT_SIZE): New symbol. (struct get_cert_s): New struct. (get_cert_data_cb, scute_agent_get_cert): New functions. 2008-09-03 Marcus Brinkmann * src/Makefile.am (.rc.o): New rule. * src/Makefile.am (EXTRA_DIST): Add stpcpy.h. 2008-09-02 Marcus Brinkmann * configure.ac: Post-release cleanup. * doc/website/download.xhtml: Update. 2008-09-02 Marcus Brinkmann * Released version 1.2.0. * doc/manual/Makefile.am (CLEANFILES): Add $(images_eps). (images_eps): New variable. (scute.dvi): Depend on $(images_eps) instead of $(images_pdf). - + 2008-08-23 Marcus Brinkmann * src/Makefile.am [HAVE_W32_SYSTEM]: Build autonomous DLL. 2008-08-23 Marcus Brinkmann * src/agent.c (gnupg_allow_set_foregound_window) [!HAVE_W32_SYSTEM]: Define it. 2008-08-23 Marcus Brinkmann * src/Makefile.am [HAVE_W32_SYSTEM]: Build autonomous DLL. * src/dllmain.c (DllMain): New file. * src/cert-gpgsm.c: Include "debug.h". Use assuan_pipe_connect_ext instead of assuan_pipe_connect everywhere. * src/agent.c (WINVER) [HAVE_W32_SYSTEM]: Define symbol. [HAVE_W32_SYSTEM]: Include . Do this before including . (gnupg_allow_set_foregound_window): New function. (agent_connect): Use Sleep() instead of _sleep(). (default_inq_cb): New function, and use it in all transactions. (agent_configure): Don't bail out if ttytname is not defined. Set allow-pinentry-notify. * tests/t-support.h [_WIN32]: Include . (init_cryptoki) [_WIN32]: Call WSAStartup. 2008-08-21 Marcus Brinkmann * src/scute.def: Start at @1 instead of @0. 2008-08-21 Marcus Brinkmann * src/agent.c (agent_configure): Fix cut and paste error. 2008-08-11 Marcus Brinkmann * src/agent.c (spawn_process_detachted) [! HAVE_W32_SYSTEM]: Remove. - (agent_configure): Ignore error with old versions of gpg-agent. + (agent_configure): Ignore error with old versions of gpg-agent. 2008-08-08 Marcus Brinkmann * configure.ac: Update svn macros. (BUILD_REVISION, BUILD_FILEVERSION, BUILD_TIMESTAMP): New. (AC_CONFIG_OUTPUT): Add src/versioninfo.rc. (GPG_AGENT_DEFAULT, GPG_AGENT): New. (AC_REPLACE_FUNCS): Add vasprintf and stpcpy. (AC_CHECK_FUNCS): Add ttyname, localtime_r and timegm. * src/stpcpy.h, src/stpcpy.c, src/realloc.c: New file from gnulib. * src/vasprintf.c: New file from libiberty. * src/support.h [!HAVE_STPCPY]: Include "stpcpy.h". [!HAVE_TTYNAME]: Define simple replacement function. (get_gpgsm_path, get_gpg_agent_path) (default_homedir, make_filename): New prototypes. * src/Makefile.am: Add W32 support. (libscute_la_SOURCES): Add get-path.c. (EXTRA_DIST): Add versioninfo.rc.in. * src/versioninfo.rc.in: New file. * src/get-path.c: New file. * src/agent.c (PATHSEP_C): New macro. (build_w32_commandline_copy) (build_w32_commandline) [HAVE_W32_SYSTEM]: New functions. (spawn_process_deatched): New function. (agent_connect): Start gpg-agent if it is not running yet. (agent_configure): Also pass xauthority and pinentry-user-data. * src/cert-gpgsm.c (COMPAT_FALLBACK) [!HAVE_W32_SYSTEM]: New macro. (export_cert_compat) [!COMPAT_FALLBACK]: Remove. (export_cert) [!COMPAT_FALLBACK]: Don't call export_cert_compat. Don't create (unused) output pipe cruft. * src/cert-object.c (time_to_ck_date) [!HAVE_LOCALTIME_R]: Fall back to localtime. * tests/t-getslotinfo.c (main) [WIN32]: Call _sleep instead sleep. * src/cryptoki.h (CRYPTOKI_EXPORTS): Define symbol. * src/error-mapping.h: Do not include . (scute_sys_to_ck): Change type of ERR to int. * src/error-mapping.c: Do not include . (scute_sys_to_ck): Change type of ERR to int. * src/slots.c (slot_create_session): Change type of ERR to int. 2007-05-03 Marcus Brinkmann Released version 1.1.0. * doc/manual/Makefile.am (images_pdf, CLEANFILES): New variables. (scute.dvi, scute.pdf): New dependencies. (%.eps, %.pdf): New rules. * configure.ac: Check for convert and epstopdf. * doc/manual/scute.texi (Authentication With Service): Avoid @indicateurl in TeX output, as this seems to be broken (in texi2dvi 1.34). * doc/manual/Makefile.am (images, EXTRA_DIST): New variables. 2007-04-30 Marcus Brinkmann * src/agent.h (scute_agent_is_trusted): New prototype. Include . * src/agent.c (scute_agent_is_trusted): New implementation. * src/cert.h (struct cert): New member IS_TRUSTED. * src/cert-gpgsm.c (export_cert): Set CERT->is_trusted. * src/cert-object.c (scute_attr_cert): Set CKA_TRUSTED to CERT->is_trusted. * tests/t-getattribute.c: Support new option '--printable'. * src/table.c (scute_table_dealloc): Return, but not a value. 2007-02-09 Marcus Brinkmann * src/pkcs11.h: Add definitions for SHA. 2006-12-17 Marcus Brinkmann * src/pkcs11.h: Minor cosmetic changes. Require CRYPTOKI_GNU now to switch on the GNU API, and do not check what CRYPTOKI_COMPAT is defined to, just if it is defined at all. * src/pkcs11.h [__WIN32]: Changed to [_WIN32 || CRYPTOKI_FORCE_WIN32] at the end. Submitted by Alon Bar-Lev. 2006-12-11 Marcus Brinkmann * src/pkcs11.h (CKO_VENDOR_DEFINED): Fixed syntax error. 2006-12-10 Marcus Brinkmann * configure.ac (NEED_GPG_ERROR_VERSION): Bump to 1.4. * src/pkcs11.h [CRYPTOKI_COMPAT]: Rewrote the compatibility layer. 2006-12-09 Marcus Brinkmann * src/pkcs11.h [__cplusplus]: Protect with extern "C". Do not use the C++ keyword "template" in parameter lists. Submitted by Alon Bar-Lev. * src/pkcs11.h [__WIN32]: Changed to [_WIN32 || CRYPTOKI_FORCE_WIN32]. (ck_rv_t): Changed to unsigned long. (CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR, CRYPTOKI_VERSION_REVISION): New macros. (CKO_VENDOR_DEFINED, CKH_VENDOR_DEFINED, CKK_VENDOR_DEFINED, CKC_VENDOR_DEFINED, CKA_VENDOR_DEFINED, CKM_VENDOR_DEFINED, CKF_EXTENSION, CKR_VENDOR_DEFINED): Add cast to suppress compiler warning. Submitted by Alon Bar-Lev. * src/cryptoki.h (CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR): Removed. 2006-11-30 Marcus Brinkmann * m4/autobuild.m4: New file. * configure.ac: Invoke AB_INIT. 2006-11-29 Marcus Brinkmann * configure.ac (CFLAGS): Remove variable. 2006-11-27 Marcus Brinkmann * src/pkcs11.h: Add more definitions provided by Andreas Jellinghaus. * README (Copyright and License): Update copyright notice. Also for all other files. * AUTHORS (Maintainer): Removed RSA Security Inc. * include/pkcs11t.h, include/pkcs11f.h, include/pkcs11.h, include/disclaimer.txt, include/cryptoki-w32.h, include/cryptoki-generic.h, include/README, include/Makefile.am: Files removed. * configure.ac (AC_CONFIG_FILES): Removed include/Makefile. * Makefile.am (SUBDIRS): Removed include directory. 2006-11-24 Marcus Brinkmann * src/pkcs11.h: New file. * src/Makefile.am (libscute_la_SOURCES): Add pkcs11.h. * src/cryptoki.h: Include "pkcs11.h" instead of original PKCS #11 header file. * tests/t-support.h (mechanism_type_str): Remove most mechanisms. 2006-11-23 Marcus Brinkmann * src/cert-gpgsm.c (search_certs_line): Don't overwrite CERT->uid. 2006-11-21 Marcus Brinkmann * src/cert-gpgsm.c (search_certs_line): Fix off-by-one error. (export_cert_cb): Fix bug if EXP->buffer_size is 0. * src/cert-gpgsm.c (cert_reset): Free CERT->cert_der if set. (export_cert): Reimplement using data channel. (export_cert_compat): This contains the old version for compatibility. * src/cert.h (MAX_CERT_SIZE): Macro removed. (struct cert): Changed member CERT_DER into a pointer. * configure.ac (AC_CONFIG_FILES): Add doc/manual/Makefile. * doc/Makefile.am (SUBDIRS): New variable. * doc/manual/Makefile, doc/manual/scute.texi, doc/manual/gpl.texi, doc/manual/mdate-sh, doc/manual/texinfo.tex, doc/manual/firefox-cm.png, doc/manual/firefox-cm-view-detail.png, doc/manual/firefox-cm-view.png, doc/manual/firefox-dm-load-after.png, doc/manual/firefox-dm-load-before.png, doc/manual/firefox-dm-load.png, doc/manual/firefox-dm-token-present.png, doc/manual/firefox-pref.png, doc/manual/firefox-pref-view.png: New files. 2006-11-11 Marcus Brinkmann * Released version 1.0.0. 2006-11-11 Marcus Brinkmann * src/error-mapping.c (scute_gpg_err_to_ck): Report error on debug stream. * src/slots.c (add_object): New function. (slot_init): Rewritten using add_object. * src/gpgsm.c: Include "gpgsm.h". (struct search): Replace members ATTRP, ATTR_COUNTP, PRV_ATTRP, PRV_ATTR_COUNTP by CERT_GET_CB, HOOK. (search_cb): Rewritten to add all certificates for a certain key (scute_gpgsm_get_cert): Take a callback function instead of attribute pointers. - * gpgsm.h (scute_gpgsm_get_cert): Adjust prototype. + * gpgsm.h (scute_gpgsm_get_cert): Adjust prototype. and also the certificate chain. * src/cert.h (scute_gpgsm_search_certs_by_fpr): New prototype. (struct cert): New member chain_id. * src/cert-gpgsm.c (struct search_ctx_by_grip): Rename to ... (struct search_ctx): ... this. Rename field GRIP to PATTERN, and add new field FIELD. (search_certs_by_grip): Rename function to ... (search_certs): ... this. (scute_gpgsm_search_certs_by_fpr): Change user of the above. (scute_gpgsm_search_certs_by_fpr): New function. (search_certs_line): Store chain ID. 2006-11-07 Marcus Brinkmann * src/p11-gettokeninfo.c (C_GetTokenInfo): Fix assignment. 2006-11-06 Marcus Brinkmann * doc/website/format/web.css: Set margin to 0. * configure.ac (AC_CONFIG_FILES): Add doc/Makefile. Makefile.am (SUBDIRS): Add doc/. doc/, doc/website/, doc/website/format: New directories. doc/Makefile.am, doc/website/index.xhtml, doc/website/documentation.xhtml, doc/website/download.xhtml, doc/website/contact.xhtml, doc/website/format/web.css, doc/website/format/scute-logo.svg, doc/website/format/scute-border.jpg: New files. 2006-10-30 Marcus Brinkmann * configure.ac (PACKAGE, VERSION): Define these variables. * src/Makefile.am (libscute_la_CPPFLAGS): Fix include path for VPATH builds. * configure.ac (VERSION_MAJOR, VERSION_MINOR): New variable definitions. * src/gpgsm.h: Fix syntax error. * src/table.c, src/table.h: Rewritten. * src/slots.c: Reorganized and rewritten to use the new table interface. Include gpgsm.h. * src/p11-signinit.c, src/p11-sign.c, src/p11-getslotlist.c, src/p11-getsessioninfo.c, src/p11-getmechanismlist.c, src/p11-getattributevalue.c, src/p11-findobjectsinit.c, src/p11-findobjectsfinal.c, src/p11-findobjects.c, src/p11-closesession.c: Adjust callers. 2006-10-26 Marcus Brinkmann * src/settings.h: Require VERSION_MAJOR and VERSION_MINOR to be defined. * src/p11-getinfo.c (CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR): Move macros to ... * src/cryptoki.h (CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR): ... here * src/gpgsm.c (gpgsm_get_cert): Rename to ... (scute_gpgsm_get_cert): ... this. * src/gpgsm.h: New file. * src/Makefile.am (libscute_la_SOURCES): Add gpgsm.h. * src/slots.c (gpgsm_get_cert): Remove prototype. (slots_update_slot): Call scute_gpgsm_get_cert, not gpgsm_get_cert. * src/error-mapping.c (scute_gpg_err_to_ck): Map GPG_ERR_NO_AGENT to CKR_GENERAL_ERROR. * src/agent.h (struct agent_card_info_s): Remove member error. Prefix external functions with scute_ if not already done so, also for callers. * src/agent.c: Include . Replace one-letter variable names by proper ones. Replace assuan_error_t with gpg_error_t everywhere. (agent_connect, agent_simple_cmd, agent_configure): New functions. (scute_agent_initialize): Use these new functions. ing of common code. Lots of cleanups. (scute_agent_finalize): Clear agent_ctx. Add debug message. 2006-10-13 Werner Koch * src/cert-gpgsm.c (MAX_LINE_LEN): Increased. * src/locking.c: Include string.h for memset declaration. * configure.ac: New option --disable-optimization. 2006-08-02 Marcus Brinkmann * Initial version. Copyright 2006, 2007, 2008 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/configure.ac b/configure.ac index 75262a6..9b0f4fd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,483 +1,486 @@ # configure.ac: Configure script for Scute. # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2015 g10 Code GmbH # # This file is part of Scute. # # Scute is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # Scute is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, see . # SPDX-License-Identifier: LGPL-2.1-or-later # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) min_automake_version="1.14" # To build a release you need to create a tag with the version number # (git tag -s scute-1.n.m) and run "./autogen.sh --force". Please # bump the version number immediately *after* the release and do # another commit and push so that the git magic is able to work. m4_define([mym4_package],[scute]) m4_define([mym4_major], [1]) m4_define([mym4_minor], [6]) m4_define([mym4_micro], [0]) # To start a new development series, i.e a new major or minor number # you need to mark an arbitrary commit before the first beta release # with an annotated tag. For example the 1.5 branch starts off with # the tag "scute-1.5-base". This is used as the base for counting # beta numbers before the first release of a series. # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a # flag indicating a development version (mym4_isbeta). Note that the # m4 processing is done by autoconf and not during the configure run. m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \ mym4_package mym4_major mym4_minor mym4_micro),[:])) m4_define([mym4_isbeta], m4_argn(2, mym4_verslist)) m4_define([mym4_version], m4_argn(4, mym4_verslist)) m4_define([mym4_revision], m4_argn(7, mym4_verslist)) m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist)) m4_esyscmd([echo ]mym4_version[>VERSION]) AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org]) # LT Version numbers, remember to change them just *before* a release. # (Code changed: REVISION++) # (Interfaces added/removed/changed: CURRENT++, REVISION=0) # (Interfaces added: AGE++) # (Interfaces removed/changed: AGE=0) # LIBSCUTE_LT_CURRENT=0 LIBSCUTE_LT_AGE=0 LIBSCUTE_LT_REVISION=3 # Version numbers reported by the PKCS #11 module to its users. VERSION_MAJOR=1 VERSION_MINOR=0 NEED_GPG_ERROR_VERSION=1.24 NEED_LIBASSUAN_VERSION=2.5.0 NEED_GPGSM_VERSION=2.2.0 # Some status variables to give feedback at the end of a configure run. have_gpg_error=no have_libassuan=no # # Provide information about the build. # BUILD_REVISION="mym4_revision" BUILD_REVISION_DEC="mym4_revision_dec" PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([src/cryptoki.h]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR(m4) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE AC_CANONICAL_HOST # Autobuilder support. AB_INIT # Enable GNU extensions on systems that have them. AC_GNU_SOURCE AH_VERBATIM([_REENTRANT], [/* To allow the use of scute in multithreaded programs we have to use special features from the library. */ #ifndef _REENTRANT # define _REENTRANT 1 #endif]) # Checks for programs. AC_PROG_CC +# Note: A suitable gitlog-to-changelog script can be found in GnuPG master. +AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog, [gitlog-to-changelog]) + # # Setup gcc specific options # AC_MSG_NOTICE([checking for cc features]) if test "$GCC" = yes; then mycflags= mycflags_save=$CFLAGS # Check whether gcc does not emit a diagnositc for unknow -Wno-* # options. This is the case for gcc >= 4.6 AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 ) #kickerror #endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no]) AC_MSG_RESULT($_gcc_silent_wno) # Note that it is okay to use CFLAGS here because these are just # warning options and the user should have a chance of overriding # them. if test "$USE_MAINTAINER_MODE" = "yes"; then mycflags="$mycflags -O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes" mycflags="$mycflags -Wformat -Wno-format-y2k -Wformat-security" if test x"$_gcc_silent_wno" = xyes ; then _gcc_wopt=yes else AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers]) CFLAGS="-Wno-missing-field-initializers" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [_gcc_wopt=yes],[_gcc_wopt=no]) AC_MSG_RESULT($_gcc_wopt) fi if test x"$_gcc_wopt" = xyes ; then mycflags="$mycflags -W -Wno-sign-compare" mycflags="$mycflags -Wno-missing-field-initializers" fi AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement]) CFLAGS="-Wdeclaration-after-statement" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no) AC_MSG_RESULT($_gcc_wopt) if test x"$_gcc_wopt" = xyes ; then mycflags="$mycflags -Wdeclaration-after-statement" fi else mycflags="$mycflags -Wall" fi if test x"$_gcc_silent_wno" = xyes ; then _gcc_psign=yes else AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign]) CFLAGS="-Wno-pointer-sign" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [_gcc_psign=yes],[_gcc_psign=no]) AC_MSG_RESULT($_gcc_psign) fi if test x"$_gcc_psign" = xyes ; then mycflags="$mycflags -Wno-pointer-sign" fi AC_MSG_CHECKING([if gcc supports -Wpointer-arith]) CFLAGS="-Wpointer-arith" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_psign=yes,_gcc_psign=no) AC_MSG_RESULT($_gcc_psign) if test x"$_gcc_psign" = xyes ; then mycflags="$mycflags -Wpointer-arith" fi CFLAGS="$mycflags $mycflags_save" fi AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization], [disable compiler optimization]), [if test $enableval = no ; then CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'` fi]) AC_SUBST(LIBSCUTE_LT_CURRENT) AC_SUBST(LIBSCUTE_LT_AGE) AC_SUBST(LIBSCUTE_LT_REVISION) AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION", [Min. needed GPGSM version.]) AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) AC_DEFINE_UNQUOTED(VERSION_MAJOR, $VERSION_MAJOR, [Major version number]) AC_DEFINE_UNQUOTED(VERSION_MINOR, $VERSION_MINOR, [Minor version number]) # Don't default to build static libs. # FIXME: Caution: Evil hack ahead. Libtool does not support linking a # static library to a shared library. But for libassuan, we need this. # Instead adding a lot of junk to Makefile.am to get this, we just override # all safety checks here. We are driving without seat belts now! # http://lists.cairographics.org/archives/cairo/2009-April/016962.html lt_cv_deplibs_check_method=pass_all LT_PREREQ([2.2.6]) LT_INIT([win32-dll disable-static]) LT_LANG([Windows Resource]) # For now we hardcode the use of version scripts. It would be better # to write a test for this or even implement this within libtool. have_ld_version_script=no case "${host}" in *-*-linux*) have_ld_version_script=yes ;; *-*-gnu*) have_ld_version_script=yes ;; *-apple-darwin*) AC_DEFINE(_DARWIN_C_SOURCE, 900000L, Expose all libc features (__DARWIN_C_FULL).) AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X) ;; esac AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") GPGSM_DEFAULT=no GPG_CONNECT_AGENT_DEFAULT=no have_w32_system=no case "${host}" in *-mingw32*) # special stuff for Windoze NT GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe' GPG_CONNECT_AGENT_DEFAULT='c:\\gnupg\\gpg-connect-agent.exe' have_w32_system=yes ;; *) ;; esac if test "$have_w32_system" = yes; then AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) fi AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) # Generate values for the DLL version info if test "$have_w32_system" = yes; then BUILD_TIMESTAMP=`date --iso-8601=minutes` changequote(,)dnl BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` changequote([,])dnl BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION_DEC}" fi AC_SUBST(BUILD_REVISION) AC_SUBST(BUILD_REVISION_DEC) AC_SUBST(BUILD_TIMESTAMP) AC_SUBST(BUILD_FILEVERSION) # Checks for libraries. AC_CHECK_FUNCS([ttyname localtime_r timegm stpcpy]) # Run the checks needed for estream-printf.c estream_PRINTF_INIT # The error code library. Error codes are sent over the IPC layer and # have to be interpreted. AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION", have_gpg_error=yes, have_gpg_error=no) # The IPC library. AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_VERSION", have_libassuan=yes, have_libassuan=no) # GPGSM NO_OVERRIDE=no AC_ARG_WITH(gpgsm, AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]), GPGSM=$withval, NO_OVERRIDE=yes) if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then GPGSM= NO_OVERRIDE=yes if test "$cross_compiling" != "yes"; then AC_PATH_PROG(GPGSM, gpgsm) fi if test -z "$GPGSM"; then GPGSM="$GPGSM_DEFAULT" fi fi if test "$GPGSM" = no; then if test "$NO_OVERRIDE" = "yes"; then if test "$cross_compiling" != "yes"; then AC_MSG_ERROR([ *** *** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it ***]) else AC_MSG_ERROR([ *** *** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH ***]) fi fi else AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.]) AC_DEFINE(ENABLE_GPGSM,1,[Whether GPGSM support is enabled]) fi AM_CONDITIONAL(HAVE_GPGSM, test "$GPGSM" != "no") dnl Check for GPGSM version requirement. GPGSM_VERSION=unknown ok=maybe if test -z "$GPGSM" -o "x$GPGSM" = "xno"; then ok=no else if test "$cross_compiling" = "yes"; then AC_MSG_WARN([GPGSM version can not be checked when cross compiling]) ok=no else if test ! -x "$GPGSM"; then AC_MSG_WARN([GPGSM not executable, version check disabled]) ok=no fi fi fi if test "$ok" = "maybe"; then AC_MSG_CHECKING(for GPGSM >= $NEED_GPGSM_VERSION) req_major=`echo $NEED_GPGSM_VERSION | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $NEED_GPGSM_VERSION | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $NEED_GPGSM_VERSION | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` gpgsm_version=`$GPGSM --version | grep ^gpgsm` major=`echo $gpgsm_version | \ sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $gpgsm_version | \ sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` micro=`echo $gpgsm_version | \ sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` GPGSM_VERSION=`echo $gpgsm_version | sed 's/^gpgsm (GnuPG) //'` if test "$major" -gt "$req_major"; then ok=yes else if test "$major" -eq "$req_major"; then if test "$minor" -gt "$req_minor"; then ok=yes else if test "$minor" -eq "$req_minor"; then if test "$micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi if test "$ok" = "yes"; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION]) fi fi gpgsm_ok="$ok" # GPG_CONNECT_AGENT NO_OVERRIDE=no AC_ARG_WITH(gpg-connect-agent, AC_HELP_STRING([--with-gpg-connect-agent=PATH], [use gpg-connect-agent binary at PATH]), GPG_CONNECT_AGENT=$withval, NO_OVERRIDE=yes) if test "$NO_OVERRIDE" = "yes" || test "$GPG_CONNECT_AGENT" = "yes"; then GPG_CONNECT_AGENT= NO_OVERRIDE=yes if test "$cross_compiling" != "yes"; then AC_CHECK_PROG(GPG_CONNECT_AGENT, gpg-connect-agent, gpg-connect-agent) fi if test -z "$GPG_CONNECT_AGENT"; then GPG_CONNECT_AGENT="$GPG_CONNECT_AGENT_DEFAULT" fi fi if test "$GPG_CONNECT_AGENT" = no; then if test "$NO_OVERRIDE" = "yes"; then if test "$cross_compiling" != "yes"; then AC_MSG_ERROR([ *** *** Could not find gpg-connect-agent, use --with-gpg-connect-agent=PATH to enable it ***]) else AC_MSG_ERROR([ *** *** Can not determine path to gpg-connect-agent when cross-compiling, use --with-gpg-connect-agent=PATH ***]) fi fi else AC_DEFINE_UNQUOTED(GPG_CONNECT_AGENT_PATH, "$GPG_CONNECT_AGENT", [Path to the GPG_CONNECT_AGENT binary.]) fi # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_INLINE # Checks for library functions. # Check for programs needed for the manual. AC_CHECK_PROG(CONVERT, convert, convert) AC_CHECK_PROG(EPSTOPDF, epstopdf, epstopdf) # Test if tests can be run ok=yes AM_CONDITIONAL(RUN_TESTS, test "$ok" = "yes") AH_BOTTOM([ /* Prefix all estream functions. */ #define _ESTREAM_EXT_SYM_PREFIX _scute_ ]) # Print errors here so that they are visible all # together and the user can acquire them all together. die=no if test "$have_gpg_error" = "no"; then die=yes AC_MSG_NOTICE([[ *** *** You need libgpg-error to build this program. ** This library is for example available at *** ftp://ftp.gnupg.org/pub/gcrypt/libgpg-error *** (at least version $NEED_GPG_ERROR_VERSION is required.) ***]]) fi if test "$have_libassuan" = "no"; then die=yes AC_MSG_NOTICE([[ *** *** You need libassuan to build this program. *** This library is for example available at *** ftp://ftp.gnupg.org/pub/gcrypt/alpha/libassuan/ *** (at least version $NEED_LIBASSUAN_VERSION is required). ***]]) fi if test "$die" = "yes"; then AC_MSG_ERROR([[ *** *** Required libraries not found. Please consult the above messages *** and install them before running configure again. ***]]) fi AC_CONFIG_FILES([Makefile m4/Makefile src/Makefile tests/Makefile doc/manual/Makefile doc/Makefile src/versioninfo.rc]) AC_OUTPUT echo " Scute v${VERSION} has been configured as follows: Revision: mym4_revision (mym4_revision_dec) Platform: $host GpgSM: ${GPGSM} Gpg-connect-agent: ${GPG_CONNECT_AGENT} " diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4 index e85f511..a9d572f 100644 --- a/m4/gpg-error.m4 +++ b/m4/gpg-error.m4 @@ -1,65 +1,188 @@ # gpg-error.m4 - autoconf macro to detect libgpg-error. -# Copyright (C) 2002, 2003, 2004 g10 Code GmbH +# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This file is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Last-changed: 2018-11-02 + dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) -dnl Test for libgpg-error and define GPG_ERROR_CFLAGS and GPG_ERROR_LIBS +dnl +dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS, +dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are +dnl used for programs requireing real multi thread support. +dnl +dnl If a prefix option is not used, the config script is first +dnl searched in $SYSROOT/bin and then along $PATH. If the used +dnl config script does not match the host specification the script +dnl is added to the gpg_config_script_warn variable. dnl AC_DEFUN([AM_PATH_GPG_ERROR], -[ AC_ARG_WITH(gpg-error-prefix, - AC_HELP_STRING([--with-gpg-error-prefix=PFX], - [prefix where GPG Error is installed (optional)]), - gpg_error_config_prefix="$withval", gpg_error_config_prefix="") - if test x$gpg_error_config_prefix != x ; then - if test x${GPG_ERROR_CONFIG+set} != xset ; then - GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config +[ AC_REQUIRE([AC_CANONICAL_HOST]) + gpg_error_config_prefix="" + dnl --with-libgpg-error-prefix=PFX is the preferred name for this option, + dnl since that is consistent with how our three siblings use the directory/ + dnl package name in --with-$dir_name-prefix=PFX. + AC_ARG_WITH(libgpg-error-prefix, + AC_HELP_STRING([--with-libgpg-error-prefix=PFX], + [prefix where GPG Error is installed (optional)]), + [gpg_error_config_prefix="$withval"]) + + dnl Accept --with-gpg-error-prefix and make it work the same as + dnl --with-libgpg-error-prefix above, for backwards compatibility, + dnl but do not document this old, inconsistently-named option. + AC_ARG_WITH(gpg-error-prefix,, + [gpg_error_config_prefix="$withval"]) + + if test x"${GPG_ERROR_CONFIG}" = x ; then + if test x"${gpg_error_config_prefix}" != x ; then + GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config" + else + case "${SYSROOT}" in + /*) + if test -x "${SYSROOT}/bin/gpg-error-config" ; then + GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config" + fi + ;; + '') + ;; + *) + AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.]) + ;; + esac fi fi AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no) - min_gpg_error_version=ifelse([$1], ,0.0,$1) - AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) + min_gpg_error_version=ifelse([$1], ,1.33,$1) ok=no - if test "$GPG_ERROR_CONFIG" != "no" ; then + + if test "$prefix" = NONE ; then + prefix_option_expanded=/usr/local + else + prefix_option_expanded="$prefix" + fi + if test "$exec_prefix" = NONE ; then + exec_prefix_option_expanded=$prefix_option_expanded + else + exec_prefix_option_expanded=$(prefix=$prefix_option_expanded eval echo $exec_prefix) + fi + libdir_option_expanded=$(prefix=$prefix_option_expanded exec_prefix=$exec_prefix_option_expanded eval echo $libdir) + + if test -f $libdir_option_expanded/pkgconfig/gpg-error.pc; then + gpgrt_libdir=$libdir_option_expanded + else + if crt1_path=$(${CC:-cc} -print-file-name=crt1.o 2>/dev/null); then + if possible_libdir=$(cd ${crt1_path%/*} && pwd 2>/dev/null); then + if test -f $possible_libdir/pkgconfig/gpg-error.pc; then + gpgrt_libdir=$possible_libdir + fi + fi + fi + fi + + if test "$GPG_ERROR_CONFIG" = "no" -a -n "$gpgrt_libdir"; then + AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no) + if test "$GPGRT_CONFIG" = "no"; then + unset GPGRT_CONFIG + else + GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir" + if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then + GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config]) + gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion` + else + unset GPGRT_CONFIG + fi + fi + else + gpg_error_config_version=`$GPG_ERROR_CONFIG --version` + fi + if test "$GPG_ERROR_CONFIG" != "no"; then req_major=`echo $min_gpg_error_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpg_error_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version` major=`echo $gpg_error_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $gpg_error_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` if test "$major" -gt "$req_major"; then ok=yes - else + else if test "$major" -eq "$req_major"; then if test "$minor" -ge "$req_minor"; then ok=yes fi fi fi + if test -z "$GPGRT_CONFIG" -a -n "$gpgrt_libdir"; then + if test "$major" -gt 1 -o "$major" -eq 1 -a "$minor" -ge 33; then + AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no) + if test "$GPGRT_CONFIG" = "no"; then + unset GPGRT_CONFIG + else + GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir" + if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then + GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config]) + else + unset GPGRT_CONFIG + fi + fi + fi + fi fi + AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) if test $ok = yes; then - GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags` - GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs` - AC_MSG_RESULT(yes) + GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags` + GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs` + if test -z "$GPGRT_CONFIG"; then + GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --mt --cflags 2>/dev/null` + GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --mt --libs 2>/dev/null` + else + GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null` + GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS" + GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null` + GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS" + fi + AC_MSG_RESULT([yes ($gpg_error_config_version)]) ifelse([$2], , :, [$2]) + if test -z "$GPGRT_CONFIG"; then + gpg_error_config_host=`$GPG_ERROR_CONFIG --host 2>/dev/null || echo none` + else + gpg_error_config_host=`$GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none` + fi + if test x"$gpg_error_config_host" != xnone ; then + if test x"$gpg_error_config_host" != x"$host" ; then + AC_MSG_WARN([[ +*** +*** The config script "$GPG_ERROR_CONFIG" was +*** built for $gpg_error_config_host and thus may not match the +*** used host $host. +*** You may want to use the configure option --with-libgpg-error-prefix +*** to specify a matching config script or use \$SYSROOT. +***]]) + gpg_config_script_warn="$gpg_config_script_warn libgpg-error" + fi + fi else GPG_ERROR_CFLAGS="" GPG_ERROR_LIBS="" + GPG_ERROR_MT_CFLAGS="" + GPG_ERROR_MT_LIBS="" AC_MSG_RESULT(no) ifelse([$3], , :, [$3]) fi AC_SUBST(GPG_ERROR_CFLAGS) AC_SUBST(GPG_ERROR_LIBS) + AC_SUBST(GPG_ERROR_MT_CFLAGS) + AC_SUBST(GPG_ERROR_MT_LIBS) ]) -