18ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project/*
28ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1
38ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *
48ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * Extracted from chap_ms.c by James Carlson.
58ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *
68ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * Copyright (c) 1995 Eric Rosenquist.  All rights reserved.
78ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *
88ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * Redistribution and use in source and binary forms, with or without
98ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * modification, are permitted provided that the following conditions
108ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * are met:
118ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *
128ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * 1. Redistributions of source code must retain the above copyright
138ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
148ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *
158ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
168ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *    notice, this list of conditions and the following disclaimer in
178ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *    the documentation and/or other materials provided with the
188ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *    distribution.
198ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *
208ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * 3. The name(s) of the authors of this software must not be used to
218ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *    endorse or promote products derived from this software without
228ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *    prior written permission.
238ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project *
248ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
258ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
268ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
278ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
288ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
298ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
308ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
318ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project */
328ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project
338ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#ifndef PPPCRYPT_H
348ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#define	PPPCRYPT_H
358ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project
368ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#ifdef HAVE_CRYPT_H
378ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#include <crypt.h>
388ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#endif
398ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project
408ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#ifndef USE_CRYPT
41e7f221f12403dcb4081d08e28c54d3b2a1ab05eeChung-yih Wang#ifdef ANDROID_CHANGES
42e7f221f12403dcb4081d08e28c54d3b2a1ab05eeChung-yih Wang#include <openssl/des.h>
43e7f221f12403dcb4081d08e28c54d3b2a1ab05eeChung-yih Wang#else
448ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#include <des.h>
458ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#endif
46e7f221f12403dcb4081d08e28c54d3b2a1ab05eeChung-yih Wang#endif
478ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project
488ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Projectextern bool	DesSetkey __P((u_char *));
498ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Projectextern bool	DesEncrypt __P((u_char *, u_char *));
508ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Projectextern bool	DesDecrypt __P((u_char *, u_char *));
518ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project
528ad0dd2a5c5f23cd210aedba72a43e48026e7436The Android Open Source Project#endif /* PPPCRYPT_H */
53