mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
Invoke the new 'unifdef:' target, and make this lib a complete subset
of the crypto (master) code.
This commit is contained in:
parent
6f3933fa6f
commit
018925b883
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87151
|
@ -32,6 +32,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
|
@ -43,6 +44,8 @@ static const char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95";
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include "misc-proto.h"
|
||||||
|
|
||||||
#define LOWER(x) (isupper(x) ? tolower(x) : (x))
|
#define LOWER(x) (isupper(x) ? tolower(x) : (x))
|
||||||
/*
|
/*
|
||||||
* The prefix function returns 0 if *s1 is not a prefix
|
* The prefix function returns 0 if *s1 is not a prefix
|
||||||
|
@ -51,7 +54,7 @@ static const char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95";
|
||||||
* the length of *s1 is returned.
|
* the length of *s1 is returned.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
isprefix(char *s1, char *s2)
|
isprefix(char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
char *os1;
|
char *os1;
|
||||||
char c1, c2;
|
char c1, c2;
|
||||||
|
@ -98,7 +101,7 @@ genget(char *name, char **table, int stlen)
|
||||||
* Function call version of Ambiguous()
|
* Function call version of Ambiguous()
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
Ambiguous(char *s)
|
Ambiguous(char **s)
|
||||||
{
|
{
|
||||||
return((char **)s == &ambiguous);
|
return(s == &ambiguous);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
|
@ -40,37 +41,36 @@ static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93";
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifdef HAS_CGETENT
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#endif
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "misc-proto.h"
|
||||||
|
|
||||||
static char *area;
|
static char *area;
|
||||||
|
static char gettytab[] = "/etc/gettytab";
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
int
|
int
|
||||||
getent(char *cp, char *name)
|
getent(char *cp __unused, const char *name)
|
||||||
{
|
{
|
||||||
#ifdef HAS_CGETENT
|
int retval;
|
||||||
char *dba[2];
|
char *tempnam, *dba[2] = { gettytab, NULL };
|
||||||
|
|
||||||
dba[0] = "/etc/gettytab";
|
tempnam = strdup(name);
|
||||||
dba[1] = 0;
|
retval = cgetent(&area, dba, tempnam) == 0 ? 1 : 0;
|
||||||
return((cgetent(&area, dba, name) == 0) ? 1 : 0);
|
free(tempnam);
|
||||||
#else
|
return(retval);
|
||||||
return(0);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SOLARIS
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
char *
|
char *
|
||||||
Getstr(char *id, char **cpp)
|
Getstr(const char *id, char **cpp __unused)
|
||||||
{
|
{
|
||||||
# ifdef HAS_CGETENT
|
int retval;
|
||||||
char *answer;
|
char *answer, *tempid;
|
||||||
return((cgetstr(area, id, &answer) > 0) ? answer : 0);
|
|
||||||
# else
|
tempid = strdup(id);
|
||||||
return(0);
|
retval = cgetstr(area, tempid, &answer);
|
||||||
# endif
|
free(tempid);
|
||||||
|
return((retval > 0) ? answer : NULL);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -65,17 +65,24 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void auth_encrypt_init P((char *, char *, char *, int));
|
void auth_encrypt_init(char *, char *, const char *, int);
|
||||||
void auth_encrypt_connect P((int));
|
void auth_encrypt_connect(int);
|
||||||
void printd P((unsigned char *, int));
|
void printd(const unsigned char *, int);
|
||||||
|
|
||||||
|
int isprefix(char *, const char *);
|
||||||
|
char **genget(char *, char **, int);
|
||||||
|
int Ambiguous(char **);
|
||||||
|
|
||||||
|
int getent(char *, const char *);
|
||||||
|
char *Getstr(const char *, char **);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These functions are imported from the application
|
* These functions are imported from the application
|
||||||
*/
|
*/
|
||||||
int net_write P((unsigned char *, int));
|
int net_write(unsigned char *, int);
|
||||||
void net_encrypt P((void));
|
void net_encrypt(void);
|
||||||
int telnet_spin P((void));
|
int telnet_spin(void);
|
||||||
char *telnet_getenv P((char *));
|
char *telnet_getenv(char *);
|
||||||
char *telnet_gets P((char *, char *, int, int));
|
char *telnet_gets(const char *, char *, int, int);
|
||||||
void printsub P((int, unsigned char *, int));
|
void printsub(char, unsigned char *, int);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
|
@ -42,6 +43,8 @@ static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93";
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
char *RemoteHostName;
|
char *RemoteHostName;
|
||||||
|
@ -49,12 +52,10 @@ char *LocalHostName;
|
||||||
char *UserNameRequested = 0;
|
char *UserNameRequested = 0;
|
||||||
int ConnectedCount = 0;
|
int ConnectedCount = 0;
|
||||||
|
|
||||||
void
|
#define undef1 __unused
|
||||||
auth_encrypt_init(local, remote, name, server)
|
|
||||||
char *local;
|
void
|
||||||
char *remote;
|
auth_encrypt_init(char *local, char *remote, const char *name undef1, int server undef1)
|
||||||
char *name;
|
|
||||||
int server;
|
|
||||||
{
|
{
|
||||||
RemoteHostName = remote;
|
RemoteHostName = remote;
|
||||||
LocalHostName = local;
|
LocalHostName = local;
|
||||||
|
@ -64,27 +65,9 @@ auth_encrypt_init(local, remote, name, server)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
auth_encrypt_user(name)
|
|
||||||
char *name;
|
|
||||||
{
|
|
||||||
extern char *strdup();
|
|
||||||
|
|
||||||
if (UserNameRequested)
|
void
|
||||||
free(UserNameRequested);
|
printd(const unsigned char *data, int cnt)
|
||||||
UserNameRequested = name ? strdup(name) : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
auth_encrypt_connect(cnt)
|
|
||||||
int cnt;
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
printd(data, cnt)
|
|
||||||
unsigned char *data;
|
|
||||||
int cnt;
|
|
||||||
{
|
{
|
||||||
if (cnt > 16)
|
if (cnt > 16)
|
||||||
cnt = 16;
|
cnt = 16;
|
||||||
|
|
Loading…
Reference in a new issue