/*
- * $Id: uams_pgp.c,v 1.5 2001-06-25 20:13:45 rufustfirefly Exp $
+ * $Id: uams_pgp.c,v 1.12 2009-10-15 11:39:48 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
#ifdef UAM_PGP
+#include <atalk/standards.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif /* HAVE_CRYPT_H */
#include <pwd.h>
-#include <syslog.h>
+#include <atalk/logger.h>
-#ifdef OPENSSL_DHX
+#if defined(GNUTLS_DHX)
+#include <gnutls/openssl.h>
+#elif defined(OPENSSL_DHX)
#include <openssl/bn.h>
#include <openssl/dh.h>
#include <openssl/cast.h>
/* pgp passwd */
static int pgp_login(void *obj, struct passwd **uam_pwd,
- char *ibuf, int ibuflen,
- char *rbuf, int *rbuflen)
+ char *ibuf, size_t ibuflen,
+ char *rbuf, size_t *rbuflen)
{
- BIGNUM *bn, *gbn, *pbn;
- u_int16_t sessid;
- int len, i;
+ size_t len, i;
char *name;
*rbuflen = 0;
if ((unsigned long) ibuf & 1) /* padding */
++ibuf;
- if (( pgppwd = uam_getname(name, i)) == NULL ) {
+ if (( pgppwd = uam_getname(obj, name, i)) == NULL ) {
return AFPERR_PARAM;
}
- syslog( LOG_INFO, "pgp login: %s", name);
+ LOG(log_info, logtype_uams, "pgp login: %s", name);
if (uam_checkuser(pgppwd) < 0)
return AFPERR_NOTAUTH;
}
static int pgp_logincont(void *obj, struct passwd **uam_pwd,
- char *ibuf, int ibuflen,
- char *rbuf, int *rbuflen)
+ char *ibuf, size_t ibuflen,
+ char *rbuf, size_t *rbuflen)
{
unsigned char iv[] = "RJscorat";
BIGNUM *bn1, *bn2, *bn3;