Path: blob/main/crypto/heimdal/lib/krb5/crypto-algs.c
34878 views
/*1* Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of the Institute nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233#include "krb5_locl.h"3435#ifndef HEIMDAL_SMALLER36#define DES3_OLD_ENCTYPE 137#endif3839struct _krb5_checksum_type *_krb5_checksum_types[] = {40&_krb5_checksum_none,41#ifdef HEIM_WEAK_CRYPTO42&_krb5_checksum_crc32,43&_krb5_checksum_rsa_md4,44&_krb5_checksum_rsa_md4_des,45&_krb5_checksum_rsa_md5_des,46#endif47#ifdef DES3_OLD_ENCTYPE48&_krb5_checksum_rsa_md5_des3,49#endif50&_krb5_checksum_rsa_md5,51&_krb5_checksum_sha1,52&_krb5_checksum_hmac_sha1_des3,53&_krb5_checksum_hmac_sha1_aes128,54&_krb5_checksum_hmac_sha1_aes256,55&_krb5_checksum_hmac_md556};5758int _krb5_num_checksums59= sizeof(_krb5_checksum_types) / sizeof(_krb5_checksum_types[0]);6061/*62* these should currently be in reverse preference order.63* (only relevant for !F_PSEUDO) */6465struct _krb5_encryption_type *_krb5_etypes[] = {66&_krb5_enctype_aes256_cts_hmac_sha1,67&_krb5_enctype_aes128_cts_hmac_sha1,68&_krb5_enctype_des3_cbc_sha1,69&_krb5_enctype_des3_cbc_none, /* used by the gss-api mech */70&_krb5_enctype_arcfour_hmac_md5,71#ifdef DES3_OLD_ENCTYPE72&_krb5_enctype_des3_cbc_md5,73&_krb5_enctype_old_des3_cbc_sha1,74#endif75#ifdef HEIM_WEAK_CRYPTO76&_krb5_enctype_des_cbc_md5,77&_krb5_enctype_des_cbc_md4,78&_krb5_enctype_des_cbc_crc,79&_krb5_enctype_des_cbc_none,80&_krb5_enctype_des_cfb64_none,81&_krb5_enctype_des_pcbc_none,82#endif83&_krb5_enctype_null84};8586int _krb5_num_etypes = sizeof(_krb5_etypes) / sizeof(_krb5_etypes[0]);878889