Expand PMF_FN_* macros.
[netbsd-mini2440.git] / usr.sbin / sup / source / netcryptvoid.c
blob95feacb93a2183f10992081dd9fb59d49ec8522a
1 /* $NetBSD: netcryptvoid.c,v 1.9 2006/12/20 16:33:34 christos Exp $ */
3 /*
4 * Copyright (c) 1992 Carnegie Mellon University
5 * All Rights Reserved.
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * Carnegie Mellon requests users of this software to return to
19 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
20 * School of Computer Science
21 * Carnegie Mellon University
22 * Pittsburgh PA 15213-3890
24 * any improvements or extensions that they make and grant Carnegie Mellon
25 * the rights to redistribute these changes.
27 /**********************************************************************
28 * HISTORY
29 * Revision 2.2 92/09/09 22:04:34 mrt
30 * Created.
31 * [92/09/09 mrt]
35 * DATA ENCRYPTION
36 * netcrypt (key) turn on/off encryption of strings and files
37 * char *key; encryption key
42 * Replacement for subroutine version of "crypt" program
43 * for foreign and non-BSD-licensed sites. With this code
44 * you can only run unencrypted sups
47 #include "libc.h"
48 #include "supcdefs.h"
49 #include "supextern.h"
50 #include "supmsg.h"
52 /*********************************************
53 *** G L O B A L V A R I A B L E S ***
54 *********************************************/
56 int cryptflag; /* whether to encrypt/decrypt data */
57 char *cryptbuf; /* buffer for data encryption/decryption */
59 int
60 netcrypt(char *pword)
62 if (pword == NULL || (strcmp(pword, PSWDCRYPT) == 0)) {
63 cryptflag = 0;
64 (void) getcryptbuf(0);
65 return (SCMOK);
67 return (SCMERR);
70 int
71 /*ARGSUSED*/
72 getcryptbuf(int x __unused)
74 if (cryptflag == 0) {
75 return (SCMOK);
76 } else
77 return (SCMERR);
80 void
81 /*ARGSUSED*/
82 decode(char *in __unused, char *out __unused, int count __unused)
87 void
88 /*ARGSUSED*/
89 encode(char *in __unused, char *out __unused, int count __unused)