diff --git a/Makefile.am b/Makefile.am index 9210aa5..276327d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -34,7 +34,7 @@ lib_LTLIBRARIES = pam_yubico.la pam_yubico_la_SOURCES = pam_yubico.c # XXX add -Wl,-x too? PAM documentation suggests it. -pam_yubico_la_LIBADD = @LTLIBYUBIKEY_CLIENT@ @LIBLDAP@ +pam_yubico_la_LIBADD = @LTLIBYKCLIENT@ @LIBLDAP@ pam_yubico_la_LDFLAGS = -module -avoid-version DEFS = -DDEBUG_PAM @DEFS@ diff --git a/NEWS b/NEWS index 7d34130..b2fdd08 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ pam_yubico NEWS -- History of user-visible changes. -*- outline -*- -* Version 1.15 (unreleased) +* Version 2.0 (unreleased) + +** Requires libykclient v2.0 or later. +See . * Version 1.14 (released 2009-03-24) diff --git a/README b/README index d74dd70..39e3943 100644 --- a/README +++ b/README @@ -50,9 +50,9 @@ Generate the build system using: == Building == -You will need to have libyubikey-client (libykclient.h, -libyubikey-client.so) and libpam-dev (security/pam_appl.h, libpam.so) -installed. Get the libyubikey-client library from: +You will need to have libykclient (ykclient.h, libykclient.so) and +libpam-dev (security/pam_appl.h, libpam.so) installed. Get the +ykclient library from: http://code.google.com/p/yubico-c-client/ diff --git a/configure.ac b/configure.ac index ef36812..4024c19 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -AC_INIT([pam_yubico], [1.15], [simon@yubico.com]) +AC_INIT([pam_yubico], [2.0], [simon@yubico.com]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign]) @@ -59,8 +59,11 @@ AC_ARG_WITH([ldap], [])]) -AC_LIB_HAVE_LINKFLAGS([yubikey-client],, [#include ], - [yubikey_client_init ();]) +AC_LIB_HAVE_LINKFLAGS([ykclient],, [#include ], + [ykclient_init (0);]) +if test "$ac_cv_libykclient" != yes; then + AC_MSG_ERROR([[Libykclient not found, get it from http://code.google.com/p/yubico-c-client/]]) +fi AC_SUBST(PAMDIR, "\$(exec_prefix)/lib/security") AC_ARG_WITH(pam-dir, diff --git a/pam_yubico.c b/pam_yubico.c index 1728689..0329d3b 100644 --- a/pam_yubico.c +++ b/pam_yubico.c @@ -63,7 +63,7 @@ # endif #endif -#include +#include #ifdef HAVE_LIBLDAP #include @@ -397,7 +397,7 @@ pam_sm_authenticate (pam_handle_t * pamh, struct pam_message *pmsg[1], msg[1]; struct pam_response *resp; int nargs = 1; - yubikey_client_t ykc = NULL; + ykclient_t *ykc = NULL; struct cfg cfg; parse_cfg (flags, argc, argv, &cfg); @@ -429,17 +429,17 @@ pam_sm_authenticate (pam_handle_t * pamh, goto done; } - ykc = yubikey_client_init (); - if (!ykc) + rc = ykclient_init (&ykc); + if (rc != YKCLIENT_OK) { - DBG (("yubikey_client_init() failed")); + DBG (("ykclient_init() failed (%d): %s", rc, ykclient_strerror (rc))); retval = PAM_AUTHINFO_UNAVAIL; goto done; } - yubikey_client_set_info (ykc, cfg.client_id, 0, NULL); + ykclient_set_client (ykc, cfg.client_id, 0, NULL); if (cfg.url) - yubikey_client_set_url_template (ykc, cfg.url); + ykclient_set_url_template (ykc, cfg.url); if (password == NULL) { @@ -522,18 +522,18 @@ pam_sm_authenticate (pam_handle_t * pamh, else password = NULL; - rc = yubikey_client_request (ykc, otp); + rc = ykclient_request (ykc, otp); - DBG (("libyubikey-client return value (%d): %s", rc, - yubikey_client_strerror (rc))); + DBG (("ykclient return value (%d): %s", rc, + ykclient_strerror (rc))); switch (rc) { - case YUBIKEY_CLIENT_OK: + case YKCLIENT_OK: break; - case YUBIKEY_CLIENT_BAD_OTP: - case YUBIKEY_CLIENT_REPLAYED_OTP: + case YKCLIENT_BAD_OTP: + case YKCLIENT_REPLAYED_OTP: retval = PAM_AUTH_ERR; goto done; @@ -561,7 +561,7 @@ pam_sm_authenticate (pam_handle_t * pamh, done: if (ykc) - yubikey_client_done (&ykc); + ykclient_done (&ykc); if (cfg.alwaysok && retval != PAM_SUCCESS) { DBG (("alwaysok needed (otherwise return with %d)", retval));