summaryrefslogtreecommitdiffstats
path: root/crypto/des/set_key.c
AgeCommit message (Collapse)Author
2021-11-05Convert the weak key and key parity tests to be constant time.Pauli
Fixes #16944 Fixes #16859 Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/16953)
2021-11-03DES_set_key(): return values as DES_set_key_checked() but always setTomas Mraz
This avoids using accidentally uninitialized key schedule in applications that use DES_set_key() not expecting it to check the key which is the default on OpenSSL <= 1.1.1 Fixes #16859 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16944)
2020-04-23Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11616)
2020-01-25Deprecate the low level DES functions.Pauli
Use of the low level DES functions has been informally discouraged for a long time. We now formally deprecate them. Applications should instead use the EVP APIs, e.g. EVP_EncryptInit_ex, EVP_EncryptUpdate, EVP_EncryptFinal_ex, and the equivalently named decrypt functions. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10858)
2019-09-28Reorganize local header filesDr. Matthias St. Pierre
Apart from public and internal header files, there is a third type called local header files, which are located next to source files in the source directory. Currently, they have different suffixes like '*_lcl.h', '*_local.h', or '*_int.h' This commit changes the different suffixes to '*_local.h' uniformly. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
2019-07-01Remove DES_check_key globalRich Salz
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9284)
2018-12-06Following the license change, modify the boilerplates in crypto/des/Richard Levitte
[skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7787)
2017-12-07Consistent formatting for sizeof(foo)Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4872)
2017-10-18Remove parentheses of return.KaoruToda
Since return is inconsistent, I removed unnecessary parentheses and unified them. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4541)
2017-10-13Remove email addresses from source code.Rich Salz
Names were not removed. Some comments were updated. Replace Andy's address with openssl.org Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4516)
2017-10-09Since return is inconsistent, I removed unnecessary parentheses andKaoruToda
unified them. - return (0); -> return 0; - return (1); -> return 1; - return (-1); -> return -1; Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4500)
2017-02-28Remove some commented out code in libcryptoMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2774)
2017-02-13DES keys are not 7 days long.Darren Tucker
CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2604)
2016-05-17Copyright consolidation 06/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix strange formatting by indentMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Further comment changes for reformat (master)Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-06Further comment amendments to preserve formatting prior to source reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-30mark all block comments that need format preserving so thatTim Hudson
indent will not alter them when reformatting comments Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-12-08Remove fips_constseg references.Dr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2011-09-14Allow for dynamic base in Win64 FIPS module.Andy Polyakov
2011-02-16Experimental symbol renaming to avoid clashes with regular OpenSSL.Dr. Stephen Henson
Make sure crypto.h is included first in any affected files.
2007-10-13Bunch of constifications.Andy Polyakov
2007-09-18Wire DES weak_keys to read-only segment.Andy Polyakov
2007-05-20OPENSSL_IMPLEMENT_GLOBAL caused more grief than it's worth (it's used twiceAndy Polyakov
in legacy code). I'd rather just remove it along with legacy interface, but it's probably not as appropriate as I'd like. Reimplement the macro.
2003-10-29A general spring-cleaning (in autumn) to fix up signed/unsigned warnings.Geoff Thorpe
I have tried to convert 'len' type variable declarations to unsigned as a means to address these warnings when appropriate, but when in doubt I have used casts in the comparisons instead. The better solution (that would get us all lynched by API users) would be to go through and convert all the function prototypes and structure definitions to use unsigned variables except when signed is necessary. The proliferation of (signed) "int" for strictly non-negative uses is unfortunate.
2002-08-02Certain flag macros were tested with #if instead if #ifdef...Richard Levitte
2001-10-24Due to an increasing number of clashes between modern OpenSSL andRichard Levitte
libdes (which is still used out there) or other des implementations, the OpenSSL DES functions are renamed to begin with DES_ instead of des_. Compatibility routines are provided and declared by including openssl/des_old.h. Those declarations are the same as were in des.h when the OpenSSL project started, which is exactly how libdes looked at that time, and hopefully still looks today. The compatibility functions will be removed in some future release, at the latest in version 1.0.
2001-07-30Make EVPs allocate context memory, thus making them extensible. RationaliseBen Laurie
DES's keyschedules. I know these two should be separate, and I'll back out the DES changes if they are deemed to be an error. Note that there is a memory leak lurking in SSL somewhere in this version.
2001-03-02Introduce the possibility to access global variables throughRichard Levitte
functions on platform were that's the best way to handle exporting global variables in shared libraries. To enable this functionality, one must configure with "EXPORT_VAR_AS_FN" or defined the C macro "OPENSSL_EXPORT_VAR_AS_FUNCTION" in crypto/opensslconf.h (the latter is normally done by Configure or something similar). To implement a global variable, use the macro OPENSSL_IMPLEMENT_GLOBAL in the source file (foo.c) like this: OPENSSL_IMPLEMENT_GLOBAL(int,foo)=1; OPENSSL_IMPLEMENT_GLOBAL(double,bar); To declare a global variable, use the macros OPENSSL_DECLARE_GLOBAL and OPENSSL_GLOBAL_REF in the header file (foo.h) like this: OPENSSL_DECLARE_GLOBAL(int,foo); #define foo OPENSSL_GLOBAL_REF(foo) OPENSSL_DECLARE_GLOBAL(double,bar); #define bar OPENSSL_GLOBAL_REF(bar) The #defines are very important, and therefore so is including the header file everywere where the defined globals are used. The macro OPENSSL_EXPORT_VAR_AS_FUNCTION also affects the definition of ASN.1 items, but that structure is a bt different. The largest change is in util/mkdef.pl which has been enhanced with better and easier to understand logic to choose which symbols should go into the Windows .def files as well as a number of fixes and code cleanup (among others, algorithm keywords are now sorted lexicographically to avoid constant rewrites).
2001-02-04Can't remember why this was needed?Ben Laurie
2000-03-19Integrate podd.h sk.h into set_key.cUlf Möller
2000-03-19cleanup.Ulf Möller
2000-03-10Use L for all constants.Ulf Möller
2000-02-03ispell (and minor modifications)Ulf Möller
1999-12-03Add functions des_set_key_checked, des_set_key_unchecked.Bodo Möller
Never use des_set_key (it depends on the global variable des_check_key), but usually des_set_key_unchecked. Only destest.c bothered to look at the return values of des_set_key, but it did not set des_check_key -- if it had done so, most checks would have failed because of wrong parity and because of weak keys.
1999-08-02avoid castBodo Möller
1999-05-16Change type of various DES function arguments from des_cblockBodo Möller
(meaning pointer to char) to des_cblock * (meaning pointer to array with 8 char elements), which allows the compiler to do more typechecking. (The changed argument types were of type des_cblock * back in SSLeay, and a lot of ugly casts were used then to turn them into pointers to elements; but it can be done without those casts.) Introduce new type const_des_cblock -- before, the pointers rather than the elements pointed to were declared const, and for some reason gcc did not complain about this (but some other compilers did).
1999-05-15Use OPENSSL_GLOBAL, OPENSSL_EXTERN instead of GLOBAL and EXTERN.Bodo Möller
1999-05-13VMS support.Ulf Möller
Submitted by: Richard Levitte <richard@levitte.org>
1999-04-26Remove NOPROTO definitions and error code comments.Ulf Möller
1999-04-19Change functions to ANSI C.Ulf Möller
1999-04-17Massive constification.Ben Laurie
1999-02-13Fix ghastly DES declarations, and all consequential warnings.Ben Laurie
1998-12-21Import of old SSLeay release: SSLeay 0.9.1b (unreleased)SSLeayRalf S. Engelschall
1998-12-21Import of old SSLeay release: SSLeay 0.9.0bRalf S. Engelschall
1998-12-21Import of old SSLeay release: SSLeay 0.8.1bRalf S. Engelschall