| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
If the PAM subprocess crashes, exit with a crash status that will be
picked up by the sshd(8) listener process where it can be used by
PerSourcePenalties to block the client. This is similar handling to
the privsep preauth process.
|
|
|
|
|
|
|
|
| |
Allows selecting which PAM service name to use when UsePAM is
enabled. Defaults to "sshd" unless overridden at compile time
by defining SSHD_PAM_SERVICE.
bz2102, ok dtucker@
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sshd would implicitly use argv[0] as the PAM service name to
allow people to select different PAM service names by making
differently-named copies/links to the sshd binary.
Splitting sshd into sshd/sshd-session broke this, as the process
that starts PAM is always sshd-session and the user has no control
over this.
Hardcode "sshd" as the default PAM service name unless/until we
figure out a better way. Should unbreak OSX integration tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
binaries. This step splits sshd into a listener and a session binary. More
splits are planned.
After this changes, the listener binary will validate the configuration,
load the hostkeys, listen on port 22 and manage MaxStartups only. All
session handling will be performed by a new sshd-session binary that the
listener fork+execs.
This reduces the listener process to the minimum necessary and sets us
up for future work on the sshd-session binary.
feedback/ok markus@ deraadt@
NB. if you're updating via source, please restart sshd after installing,
otherwise you run the risk of locking yourself out.
OpenBSD-Commit-ID: 43c04a1ab96cdbdeb53d2df0125a6d42c5f19934
|
|
|
|
|
|
| |
This changes SSH_AUTH_INFO_0 to be exposed to PAM auth modules also
when a password authentication method is in use and not only
when a keyboard-interactive authentication method is in use.
|
| |
|
|
|
|
|
| |
These too are unreachable, but we want the code to be safe regardless of
context. Reported by Yair Mizrahi @ JFrog
|
|
|
|
| |
From Coverity CID 405194, tweaks and ok djm@
|
|
|
|
|
|
| |
Prompted by bz#3508: there's no need to cache the value of
sshpam_conninfo so remove the global. While there, add check of
return value from pam_putenv. ok djm@
|
|
|
|
|
| |
*info is allocated via xstrdup but was leaked in the PAM_AUTH_ERR path.
From github PR#266.
|
|
|
|
|
| |
challenge_response_authentication was removed from the struct, keeping
kbd_interactive_authentication.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a mitigation for a buffer overflow in Solaris' PAM username
handling (CVE-2020-14871), and is only enabled for Sun-derived PAM
implementations. This is not a problem in sshd itself, it only
prevents sshd from being used as a vector to attack Solaris' PAM.
It does not prevent the bug in PAM from being exploited via some other
PAM application.
Based on github PR#212 from Mike Scott but implemented slightly
differently. ok tim@ djm@
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
sigaction(2). This wrapper blocks all other signals during the handler
preventing races between handlers, and sets SA_RESTART which should reduce
the potential for short read/write operations.
OpenBSD-Commit-ID: 5e047663fd77a40d7b07bdabe68529df51fd2519
|
|
|
|
|
| |
sshpam_password_change_required is only used in auth-pam.c, so make it
static to prevent a mising prototype warning.
|
|
|
|
| |
Include stdlib.h for calloc, malloc, free and setenv.
|
|
|
|
| |
coverity report via Ed Maste; ok dtucker@
|
|
|
|
|
| |
Patch from knweiss at gmail.com via github pull req #97 (portable-
specific parts).
|
|
|
|
|
|
| |
According to POSIX, pthread_create returns the failure reason in
the non-zero function return code so make the fork wrapper do that.
Matches previous change.
|
|
|
|
|
| |
Found by inspection after finding similar bugs in other code used by
Android.
|
|
|
|
|
|
| |
Some platforms such as HP-UX do not have pam_putenv. Currently the
calls are ifdef'ed out, but a new one was recently added. Remove the
ifdefs and add a no-op implementation. bz#3008, ok djm.
|
|
|
|
|
| |
Requires some caching of values, because the PAM code isn't
always called with packet context.
|
|
|
|
|
| |
This makes the connection 4-tuple available to PAM modules that
wish to use it in decision-making. bz#2741
|
|
|
|
| |
Polyfill missing API with replacement functions extracted from LibreSSL
|
|
|
|
|
| |
Commit 5467fbcb removed key.h so stop including it in portable files
too. Fixes builds on lots of platforms.
|
| |
|
|
|
|
| |
bz#2408, patch from Radoslaw Ejsmont; ok dtucker@
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
remove the legacy one.
Includes a fairly big refactor of auth2-pubkey.c to retain less state
between key file lines.
feedback and ok markus@
OpenBSD-Commit-ID: dece6cae0f47751b9892080eb13d6625599573df
|
|
|
|
| |
bz#2408; ok dtucker@
|
|
|
|
|
| |
Server-side support for Protocol 1 has been removed so remove !compat20
PAM code path.
|
|
|
|
| |
Part of bz#2687, from jjelen at redhat.com.
|
|
|
|
|
| |
The callers of do_pam_set_tty were removed in 2008, so this is now dead
code. bz#2604, pointed out by jjelen at redhat.com.
|
|
|
|
| |
Saves messing around with CFLAGS to do it.
|
|
|
|
| |
patch from Jakub Jelen on bz#2581; ok dtucker@
|
|
|
|
|
|
|
|
|
|
|
| |
bz#2249: handle the case where PAM returns PAM_MAXTRIES by ceasing to offer
password and keyboard-interative authentication methods. Should prevent
"sshd ignoring max retries" warnings in the log. ok djm@
It probably won't trigger with keyboard-interactive in the default
configuration because the retry counter is stored in module-private
storage which goes away with the sshd PAM process (see bz#688). On the
other hand, those cases probably won't log a warning either.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When sshd decides to not allow a login (eg PermitRootLogin=no) and
it's using PAM, it sends a fake password to PAM so that the timing for
the failure is not noticeably different whether or not the password
is correct. This behaviour can be detected by sending a very long
password string which is slower to hash than the fake password.
Mitigate by constructing an invalid password that is the same length
as the one from the client and thus takes the same time to hash.
Diff from djm@
|
| |
|
|
|
|
| |
From mschwager via github.
|
| |
|
|
|
|
|
| |
Change old $FreeBSD version string in comment so it doesn't
become an RCS ident downstream; requested by des AT des.no
|
| |
|
|
|
|
| |
Patch from Loganaden Velvindron.
|
|
|
|
|
|
|
|
| |
groupaccess.c loginrec.c monitor.c monitor_wrap.c session.c sshd.c
sshlogin.c uidswap.c openbsd-compat/bsd-cygwin_util.c
openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/port-aix.c
openbsd-compat/port-linux.c] Replace portable-specific instances of xfree
with the equivalent calls to free.
|
|
|
|
| |
logout to after the session close. Patch from Anicka Bernathova, ok djm.
|
|
|
|
|
|
| |
pam_open_session and pam_close_session into the privsep monitor, which
will ensure that pam_session_close is called as root. Patch from Tomas
Mraz.
|
| |
|
|
|
|
| |
sshpam_tty_conv. Patch from ldv at altlinux.org.
|