diff options
Diffstat (limited to 'src/pam_rps.c')
-rw-r--r-- | src/pam_rps.c | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/src/pam_rps.c b/src/pam_rps.c index a68c0ab..5a225de 100644 --- a/src/pam_rps.c +++ b/src/pam_rps.c @@ -1,8 +1,5 @@ -/****************************************************************************** - * A truly challenge-response module for PAM. - * - * Copyright (c) 2003 Red Hat, Inc. - * Written by Nalin Dahyabhai <nalin@redhat.com> +/* + * Copyright (c) 2003,2010 Red Hat, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -16,34 +13,20 @@ * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. - * - * ALTERNATIVELY, this product may be distributed under the terms of - * the GNU Public License, in which case the provisions of the GPL are - * required INSTEAD OF the above restrictions. (This clause is - * necessary due to a potential bad interaction between the GPL and - * the restrictions contained in a BSD-style copyright.) - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <sys/types.h> +#include <errno.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> #include <syslog.h> #include <unistd.h> -#include <errno.h> + #include <security/pam_modules.h> #include <security/_pam_macros.h> #include <security/pam_ext.h> @@ -91,9 +74,10 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) * Bleichenbacher's attack. */ r = c / 85; close(fd); - } - else /* Something is wrong with /dev/urandom */ + } else { + /* Something is wrong with /dev/urandom */ return PAM_CONV_ERR; + } } switch (r) { case 0: @@ -115,8 +99,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) } ret = pam_prompt(pamh, PAM_PROMPT_ECHO_OFF, &response, "%s: ", prompt_text); if (ret != PAM_SUCCESS) { - pam_syslog(pamh, LOG_CRIT, - "conversation error"); + pam_syslog(pamh, LOG_CRIT, "conversation error"); return PAM_CONV_ERR; } if ((response != NULL) && |