/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 1989 The Regents of the University of California.4* All rights reserved.5*6* This code is derived from software contributed to Berkeley by7* Tom Truscott.8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions and the following disclaimer.14* 2. Redistributions in binary form must reproduce the above copyright15* notice, this list of conditions and the following disclaimer in the16* documentation and/or other materials provided with the distribution.17* 3. Neither the name of the University nor the names of its contributors18* may be used to endorse or promote products derived from this software19* without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND22* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE25* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL26* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS27* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)28* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT29* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY30* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF31* SUCH DAMAGE.32*/3334#include <stdio.h>35#include <string.h>36#include <unistd.h>3738/*39* UNIX password, and DES, encryption.40*41* since this is non-exportable, this is just a dummy. if you want real42* encryption, make sure you've got libcrypt.a around.43*/4445int __freebsd11_des_setkey(const char *key);46int __freebsd11_des_cipher(const char *in, char *out, long salt, int num_iter);47int __freebsd11_setkey(const char *key);48int __freebsd11_encrypt(char *block, int flag);4950/* ARGSUSED */51int52__freebsd11_des_setkey(const char *key __unused)53{54fprintf(stderr, "WARNING! des_setkey(3) not present in the system!\n");55return (0);56}5758/* ARGSUSED */59int60__freebsd11_des_cipher(const char *in, char *out, long salt __unused,61int num_iter __unused)62{63fprintf(stderr, "WARNING! des_cipher(3) not present in the system!\n");64bcopy(in, out, 8);65return (0);66}6768/* ARGSUSED */69int70__freebsd11_setkey(const char *key __unused)71{72fprintf(stderr, "WARNING! setkey(3) not present in the system!\n");73return (0);74}7576/* ARGSUSED */77int78__freebsd11_encrypt(char *block __unused, int flag __unused)79{80fprintf(stderr, "WARNING! encrypt(3) not present in the system!\n");81return (0);82}8384__sym_compat(des_setkey, __freebsd11_des_setkey, FBSD_1.0);85__sym_compat(des_cipher, __freebsd11_des_cipher, FBSD_1.0);86__sym_compat(setkey, __freebsd11_setkey, FBSD_1.0);87__sym_compat(encrypt, __freebsd11_encrypt, FBSD_1.0);888990