X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fdes%2Fset_key.c;h=dc9e8451f32d1c889ff3b4d2e75008e1afa9d0e5;hb=7b2ce4a6e817e4385ff77fea0c6e349294c7b756;hp=0a57f31f1e86cf9df8ec2c87d476b26276bd8f22;hpb=26a7d938c9bf932a55cb5e4e02abb48fe395c5cd;p=oweals%2Fopenssl.git diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c index 0a57f31f1e..dc9e8451f3 100644 --- a/crypto/des/set_key.c +++ b/crypto/des/set_key.c @@ -1,7 +1,7 @@ /* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html @@ -15,11 +15,15 @@ * 1.1 added norm_expand_bits * 1.0 First working version */ -#include -#include "des_locl.h" -/* defaults to false */ -OPENSSL_IMPLEMENT_GLOBAL(int, DES_check_key, 0) +/* + * DES low level APIs are deprecated for public use, but still ok for internal + * use. + */ +#include "internal/deprecated.h" + +#include +#include "des_local.h" static const unsigned char odd_parity[256] = { 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14, @@ -277,12 +281,7 @@ static const DES_LONG des_skb[8][64] = { int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule) { - if (DES_check_key) { - return DES_set_key_checked(key, schedule); - } else { - DES_set_key_unchecked(key, schedule); - return 0; - } + return DES_set_key_checked(key, schedule); } /*- @@ -310,7 +309,7 @@ void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) register int i; #ifdef OPENBSD_DEV_CRYPTO - memcpy(schedule->key, key, sizeof schedule->key); + memcpy(schedule->key, key, sizeof(schedule->key)); schedule->session = NULL; #endif k = &schedule->ks->deslong[0];