1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2024-11-29 00:24:11 +01:00

Use and require libykclient v2.0+.

This commit is contained in:
Simon Josefsson 2009-03-25 10:15:13 +00:00
parent ddf7a8cf36
commit b18d8ef79a
5 changed files with 28 additions and 22 deletions

View File

@ -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@

5
NEWS
View File

@ -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 <http://code.google.com/p/yubico-c-client/>.
* Version 1.14 (released 2009-03-24)

6
README
View File

@ -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/

View File

@ -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 <libykclient.h>],
[yubikey_client_init ();])
AC_LIB_HAVE_LINKFLAGS([ykclient],, [#include <ykclient.h>],
[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,

View File

@ -63,7 +63,7 @@
# endif
#endif
#include <libykclient.h>
#include <ykclient.h>
#ifdef HAVE_LIBLDAP
#include <ldap.h>
@ -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));