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

756 Commits

Author SHA1 Message Date
Klas Lindfors
3d71fce7ba
Merge branch 'pr-200' 2019-09-24 10:15:36 +02:00
Marc Sensenich
027f5950d8 Compare Token from LDAP and Input Against Configured Length 2019-09-23 18:03:47 -04:00
Klas Lindfors
b5bd00db81
Merge branch 'pr-196' 2019-07-01 08:35:04 +02:00
Yuping Zuo
4d8d39dea8
Fix filename in makefile 2019-06-28 22:29:11 +08:00
Yuping Zuo
43d5c39880
Update SELinux doc
Added instructions on how to re-enable SELinux
2019-06-27 10:23:17 +08:00
Yuping Zuo
da79e1d5dc
Rename and update SELinux doc
- Renamed the title to remove Fedora as this applies to Enterprise Linux too.
- Added a new section on debugging with sshd.
2019-06-27 10:20:13 +08:00
Klas Lindfors
3d8d06d949
use lstat() when checking for existance of user mapping file
this treats the existance of a symlink as an intent to configure the
mapping and will fail in check_user_token() instead
2019-06-26 14:58:45 +02:00
Klas Lindfors
f300115a64
check if user file exists before trying to open
and return AUTH_NO_TOKENS if file doesn't exist. This fixes issues in
the nullok case where this user should just be skipped over, handle
other issues with user file as an AUTH_ERROR.

fixes #194
2019-06-24 14:13:47 +02:00
Klas Lindfors
fcfcba6c2f
Merge branch 'pr-192' 2019-06-10 10:18:43 +02:00
Gabriel Kihlman
9d24c966c3
Avoid potentially following a symlink with open() 2019-05-15 12:50:05 +02:00
Gabriel Kihlman
bec4e43732
Fix a TOCTOU case when opening the debug_file
This also unifies the code between pam-u2f and yubico-pam which means
removing the O_CREAT flag here. This is however in line with the README
and the behaviour of pam-u2f. Also, the previous code did lstat on the
path before and if it did not exist it would not have moved on to the
open() anyways.
2019-05-15 12:38:24 +02:00
Klas Lindfors
1c6fa66825
Merge branch 'pr-189' 2019-03-19 15:10:00 +01:00
Gabriel Kihlman
5498bcf53f
Fix two minor memory leaks in error paths
Found by cppcheck
2019-03-19 14:49:45 +01:00
Klas Lindfors
f7b1e051bd
Merge branch 'pr-188' 2019-03-19 14:48:09 +01:00
Gabriel Kihlman
9531bc3c76
Fix pam_get_data stack overwrite by saving a heap pointer instead
The previous code was using a trick of saving the actual retval value
as the "pointer". The problem with that was when pam_get_data copied
it out it treated it as a void* which is 8 byte on 64 bit operating
system which meant it copied 8 byte to a 4 byte location and overwrote
the stack with 4 bytes.

The fix is using a heap pointer instead, influenced by the official
code in https://github.com/linux-pam/linux-pam/blob/master/modules/pam_unix/pam_unix_auth.c

With feedback from pedro martelletto, thanks.
2019-03-19 14:28:18 +01:00
Klas Lindfors
eca00d0a58
Merge branch 'pr-187' 2019-02-06 09:31:06 +01:00
Klas Lindfors
cc14ad4d39
Merge branch 'pr-186' 2019-02-06 09:29:43 +01:00
Gabriel Kihlman
b1fbb1ab64
Add missing header file missing in the last commit 2019-02-04 20:37:42 +01:00
Gabriel Kihlman
76034c1054
Scrub sensitive data from memory
Fixes issue #185
2019-02-04 19:50:30 +01:00
Gabriel Kihlman
5f7d7964de
Ensure that the debug log always outputs a valid OTP and not an accidental password
Fixes issue #184
2019-02-04 10:25:31 +01:00
Klas Lindfors
456c2a125d
Merge branch 'pr-181' 2019-01-15 08:28:36 +01:00
James Magahern
413037c7e5 Fixes issue where if the challenge-response cannot be updated, the incorrect error message is displayed
If the PAM module cannot update the challenge response file (due to permissions errors, usually), the incorrect error message is displayed "Error communicating with YubiKey...".

This patch makes it so the correct error message is sent to the PAM client, which makes resolving this issue a lot easier.
2019-01-14 11:23:56 -08:00
Klas Lindfors
2b0756b5de
Merge branch 'pr-180' 2019-01-09 08:59:05 +01:00
Stephen Gelman
1c693f562c Add always_prompt configuration option to skip initial check for YubiKey
As raised in #174, ldap_bind_as_user cannot be used if this module is
set to get YubiKey+OTP because the initial ldap lookup fails (since the
password is not set yet).  `always_prompt` will stil the initial lookup,
meaning that the user will be given the chance to enter their password.
2019-01-08 04:51:13 +00:00
Klas Lindfors
3beba14eeb
Merge branch 'pr-179' 2019-01-02 08:57:35 +01:00
Tero Paloheimo
be2fdfdada Fix implicit declaration warning of mkostemp
mkostemp() requires the _GNU_SOURCE feature test macro.
See man 3 mkostemp.
2019-01-01 21:54:47 +02:00
Klas Lindfors
3d24e8fd02
Merge branch 'pr-172' 2018-11-13 09:27:24 +01:00
Stephen Gelman
c8c76fbf4c Add support for LDAP client certificate authentication
This adds support for using a client cert/key to authenticate to an LDAP
server.  It is separate from binding with a username and password and
can either be used alongside it or with an anonymous bind to the server.
2018-11-12 18:28:56 +00:00
Stephen Gelman
fc2dc1a025 Add STARTTLS support for LDAP
This allows connecting to LDAP servers that only listen on port 389 but
use STARTTLS to get a TLS connection
2018-11-12 18:28:56 +00:00
Stephen Gelman
8512e5cee8 Add ldap_bind_as_user support
This allows using the authenticating user's username and password to
bind to the LDAP server.  This is desirable because it allows for
looking up the yubikey attributes without needing to create a service
account.
2018-11-12 18:28:50 +00:00
Klas Lindfors
1fe13aa067
Merge branch 'pr-170' 2018-10-29 08:27:31 +01:00
Tero Paloheimo
2af4dafb55 Add man page building dependencies to README
Some further packages are needed to build the man page so I added them
to the README to other users who are building from source.
2018-10-27 13:57:04 +03:00
Klas Lindfors
3b6378e334
Merge branch 'pr-169' 2018-10-24 15:35:13 +02:00
Tero Paloheimo
9341f3477a Fix compiler warning in pam_test.c
Compiler cannot find the declaration for pm_sm_authenticate and prints
the following warning (split due to long line):
pam_test.c:184:10: warning: implicit declaration of function
‘pam_sm_authenticate’; did you mean ‘pam_authenticate’?
[-Wimplicit-function-declaration]
2018-10-24 16:29:11 +03:00
Klas Lindfors
a9b2057db9
Merge branch 'pr-167' 2018-09-13 21:20:56 +02:00
Björn Wiedenmann
bef666a899 Fix buffer overflow in write_chalresp_state()
Buffer was defined as CR_SALT_SIZE = 32 but number of random bytes
was CR_CHALLENGE_SIZE = 63.
2018-08-15 19:59:38 +02:00
Klas Lindfors
05f74ea8e5
Merge branch 'pr-165' 2018-05-23 10:56:26 +02:00
Klas Lindfors
7419287506
Merge branch 'pr-164' 2018-05-23 10:56:21 +02:00
Karol Babioch
6be87e75af Close file descriptors in case fdopen() fails
This makes sure that file descriptors will be closed, even if the
fdopen() call failes, which was overlooked in some cases beforehand.
Should be not an issue in the real world, but let's be as clean as
possible.
2018-05-22 17:27:21 +02:00
Karol Babioch
eb17d840a6 Fix minor typo 2018-05-22 17:24:24 +02:00
Klas Lindfors
b240534c46
Merge branch 'pr-163' 2018-05-18 12:26:50 +02:00
Karol Babioch
a68d3be1bc Make code C90 compliant
This moves variable declrations to the beginning of a block to be C90-compliant.
2018-05-18 12:22:07 +02:00
Klas Lindfors
13ce1b6f52
Merge branch 'pr-162' 2018-05-18 11:48:14 +02:00
Klas Lindfors
b72fa76113
Merge branch 'pr-156' 2018-05-18 11:47:18 +02:00
Karol Babioch
80e7484aea pam_yubico.c: Check for return codes of snprintf() 2018-05-17 16:31:36 +02:00
Karol Babioch
f77893a11c util.c: Check for return codes of snprintf() 2018-05-17 16:28:22 +02:00
Karol Babioch
2f172e3227 ykpamcfg.c: Check also for negative return code of snprintf() 2018-05-17 16:22:15 +02:00
Karol Babioch
f94095879a pam_yubico.c: Use snprintf() instead of sprintf() 2018-05-17 16:18:53 +02:00
Karol Babioch
0972986164 util.c: Check whether generate_random() was invoked successfully
This evaluates the return code from generate_random() within
write_chalresp_state() and returns immediately in case of an error.

This fixes #161.
2018-05-17 16:09:40 +02:00
Klas Lindfors
3339cd2864
add note about physical security. 2018-05-16 09:13:50 +02:00