]> git.ozlabs.org Git - ppp.git/blob - pppd/crypto_ms.h
Makefile.am: Add explicit openssl directory to pppd include path
[ppp.git] / pppd / crypto_ms.h
1 /*
2  * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1
3  *
4  * Extracted from chap_ms.c by James Carlson.
5  * Updated to better reflect RFC2759 by Eivind Naess
6  *
7  * Copyright (c) 2022 Eivind Naess.  All rights reserved.
8  * Copyright (c) 1995 Eric Rosenquist.  All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  *
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in
19  *    the documentation and/or other materials provided with the
20  *    distribution.
21  *
22  * 3. The name(s) of the authors of this software must not be used to
23  *    endorse or promote products derived from this software without
24  *    prior written permission.
25  *
26  * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
27  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
28  * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
29  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
30  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
31  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
32  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
33  */
34 #ifndef PPP_PPPCRYPT_H
35 #define PPP_PPPCRYPT_H
36
37 #include "pppdconf.h"
38
39 /**
40  * This is the DES encrypt functions as described by RFC2759.
41  * 
42  * Parameters:
43  * unsigned char *clear:
44  *      A 8 byte input array to be encrypted
45  * 
46  * unsigned char *key: 
47  *      A raw 7-byte array to be expanded to 8 with odd-parity
48  *
49  * unsigned char *cipher:
50  *      A 8 byte outut array providing space for the output data
51  *
52  * DesEncrypt returns 1 on success
53  */
54 int DesEncrypt(unsigned char *clear, unsigned char *key, 
55         unsigned char *cipher);
56
57 /**
58  * This is the DES decrypt functions as described by RFC2759.
59  * 
60  * Parameters:
61  * unsigned char *cipher:
62  *      A 8 byte input array to be decrypted
63  *
64  * unsigned char *key: 
65  *      A raw 7-byte array to be expanded to a 8-byte key with odd-parity
66  *
67  * unsigned char *clear:
68  *      A 8 byte output array providing space for the output data
69  *
70  * DesDecrypt returns 1 on success
71  */
72 int DesDecrypt(unsigned char *cipher, unsigned char *key, 
73         unsigned char *clear);
74
75 #endif /* PPP_PPPCRYPT_H */