summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto
Commit message (Collapse)AuthorAgeFilesLines
...
* * shs.c (SHSTransform) [CONFIG_SMALL]: Roll loops for each roundKen Raeburn2005-05-012-0/+32
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17209 dc483132-0cff-0310-8789-dd5450dbe970
* * md5.c (Transform) [CONFIG_SMALL]: Roll loops for each roundKen Raeburn2005-05-012-0/+60
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17208 dc483132-0cff-0310-8789-dd5450dbe970
* * md4.c (Transform) [CONFIG_SMALL]: Roll loops for each roundKen Raeburn2005-05-012-0/+27
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17207 dc483132-0cff-0310-8789-dd5450dbe970
* * t_crc.c (main): Don't run timing test for nowKen Raeburn2005-05-012-1/+7
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17206 dc483132-0cff-0310-8789-dd5450dbe970
* * yarrow.c: Delete old macintosh support.Ken Raeburn2005-04-282-13/+21
| | | | | | | | | (yarrow_input_maybe_locking): Do the optional locking, and verify that the mutex is locked, before doing anything else. (yarrow_reseed_locked): Verify that the global mutex is locked before doing anything else. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17204 dc483132-0cff-0310-8789-dd5450dbe970
* Allow compile-time specification that small code space is desiredKen Raeburn2005-04-135-15/+61
| | | | | | | | | | | | | | | | | | | | | * d3_cbc.c (krb5int_des3_cbc_encrypt, krb5int_des3_cbc_decrypt): Don't declare left and right variables as registers. * f_cksum.c (mit_des_cbc_cksum): Likewise. * f_cbc.c (krb5int_des_cbc_encrypt, krb5int_des_cbc_decrypt): Likewise. (krb5int_des_cbc_encrypt): For full blocks, use GET_HALF_BLOCK to read and then xor, instead of processing each byte individually. (krb5int_des_do_encrypt_2, krb5int_des_do_decrypt_2) [CONFIG_SMALL]: New functions, wrapping large macros with the DES inner loops. * f_tables.h (DES_DO_ENCRYPT_1, DES_DO_DECRYPT_1): Renamed from non-_1 names. (krb5int_des_do_encrypt_2, krb5int_des_do_decrypt_2): Declare if CONFIG_SMALL is defined. (DES_DO_ENCRYPT, DES_DO_DECRYPT): Expand to _1 macros or _2 function calls depending on whether CONFIG_SMALL is defined. With CONFIG_SMALL defined, on x86/gcc/glibc, this drops about 5K (25%) of the code/table space. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17183 dc483132-0cff-0310-8789-dd5450dbe970
* * aesopt.h: On PalmOS, include FloatMgr.h to get endianness flag.Ken Raeburn2005-04-132-7/+14
| | | | | | | | | | | (ENC_UNROLL, DEC_UNROLL, ENC_ROUND, LAST_ENC_ROUND, DEC_ROUND, LAST_DEC_ROUND, KEY_SCHED): If CONFIG_SMALL is defined, set to NONE or NO_TABLES as appropriate. (Latter change drops about 40K -- over 85% -- from AES code/table size in shared libraries on x86/glibc/gcc.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17182 dc483132-0cff-0310-8789-dd5450dbe970
* * aes_s2k.c (krb5int_aes_string_to_key): Widen bytes of iteration count ↵Ken Raeburn2005-04-132-1/+8
| | | | | | before shifting git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17181 dc483132-0cff-0310-8789-dd5450dbe970
* * Makefile.in (all-unix): Don't build aes-gen by default, leave it for 'make ↵Ken Raeburn2005-04-132-1/+6
| | | | | | check' git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17180 dc483132-0cff-0310-8789-dd5450dbe970
* krb5_c_is_keyed_cksum() is a boolean function. It cannot safely returnJeffrey Altman2005-03-152-1/+10
| | | | | | | | | an error value. Change the error condition to return False (0) instead of 0xFFFFFFFF. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17127 dc483132-0cff-0310-8789-dd5450dbe970
* * prng.c (krb5int_prng_init): Incorporate do_yarrow_init body. Don't checkKen Raeburn2005-01-142-28/+19
| | | | | | | | | | | | inited variable. (inited): Variable deleted. (krb5_c_random_make_octets, krb5int_prng_cleanup): Don't check it. (do_yarrow_init): Deleted. ticket: 2878 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17033 dc483132-0cff-0310-8789-dd5450dbe970
* * yarrow.c (yarrow_reseed_locked): Renamed from krb5int_yarrow_reseed and madeKen Raeburn2005-01-142-6/+27
| | | | | | | | | | | | | | static. (Yarrow_detect_fork, yarrow_input_maybe_locking, krb5int_yarrow_output_Block): Call it. (krb5int_yarrow_reseed): New function, grabs lock and calls the old version. (krb5int_yarrow_final): Hold the lock until after clearing the Yarrow context data. ticket: 2878 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17032 dc483132-0cff-0310-8789-dd5450dbe970
* Tree does not compile with GCC 4.0Ezra Peisach2005-01-132-0/+6
| | | | | | | | | | | | * yarrow.c: Declare yarrow_gate_locked static before first use. GCC 4.0 snapshots are more particular about using a static function before a prototype is given. ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17024 dc483132-0cff-0310-8789-dd5450dbe970
* * prng.c (read_entropy_from_device): Use ssize_t, not size_t, soTom Yu2005-01-132-1/+6
| | | | | | | | | read() returning -1 doesn't cause trouble. ticket: 2871 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17020 dc483132-0cff-0310-8789-dd5450dbe970
* * crc-32.h (mit_crc32): Remove gratuitous "const" in argument declarationKen Raeburn2005-01-082-1/+6
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17011 dc483132-0cff-0310-8789-dd5450dbe970
* run "make depend"Ken Raeburn2004-12-3015-393/+410
| | | | | | | | In most library directories, this just affects where the line breaks are. In most other directories, it's just dropping a trailing blank line. One or two files really do have updated dependencies. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16987 dc483132-0cff-0310-8789-dd5450dbe970
* KDC on Tru64 was hanging because of another case where Yarrow codeKen Raeburn2004-11-232-12/+47
| | | | | | | | | | | | | | | | | assumes locks are recursive. Probably didn't trigger on Linux, Solaris, or NetBSD because they have /dev/random and Tru64 does not. * yarrow.c (yarrow_input_maybe_locking): Renamed from yarrow_input_maybe_locking, made static. New argument indicates whether or not to do locking. (krb5int_yarrow_input): New wrapper function. (yarrow_input_locked): New wrapper function. (Yarrow_detect_fork): Call yarrow_input_locked. ticket: 2755 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16903 dc483132-0cff-0310-8789-dd5450dbe970
* * prng.c (do_yarrow_init): Move mutex initialization here.Ken Raeburn2004-11-172-1/+12
| | | | | | (krb5int_prng_init): Don't do it here. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16880 dc483132-0cff-0310-8789-dd5450dbe970
* Convert Yarrow to use AES not 3des. Update test vectorsSam Hartman2004-11-166-11/+20
| | | | | | | ticket: 2410 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16870 dc483132-0cff-0310-8789-dd5450dbe970
* * yarrow.c (krb5int_yarrow_input, krb5int_yarrow_final): Don't check forKen Raeburn2004-11-012-7/+47
| | | | | | | | | | forking here. (yarrow_output_locked): Split out from krb5int_yarrow_output, without locking. (krb5int_yarrow_output): Do locking and call yarrow_output_locked. (yarrow_gate_locked): New function; uses yarrow_output_locked. (krb5int_yarrow_output_Block): Use yarrow_gate_locked. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16853 dc483132-0cff-0310-8789-dd5450dbe970
* push yarrow locking down into the yarrow code to reduce contentionKen Raeburn2004-10-304-17/+29
| | | | | | | | | | | | | | | | | | This seems to speed up creating a krb5_context a little bit, when it happens a lot in multiple threads. * prng.c (yarrow_lock): Rename to krb5int_yarrow_lock via macro, and change to be non-static. (krb5int_prng_init): Call do_yarrow_init here. (krb5_c_random_add_entropy): Don't call it here. Don't lock the mutex, either. (krb5_c_random_make_octets): Don't lock the mutex. * yarrow/ylock.h: Include k5-thread.h. (krb5int_yarrow_lock): Declare. (LOCK, UNLOCK): Define as macros using the k5_mutex_ macros. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16846 dc483132-0cff-0310-8789-dd5450dbe970
* * vbaxam.doc: File deletedKen Raeburn2004-09-282-0/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16793 dc483132-0cff-0310-8789-dd5450dbe970
* memory leak in arcfour string_to_keySam Hartman2004-09-212-0/+6
| | | | | | | | | | | Derrick Schommer reports that arcfour's string_to_key function leaks memory. This is true; it copies the password to convert to utf16 and never frees the copy. It does memset the copy to 0 when done. ticket: new requestors: schommer@gmail.com git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16771 dc483132-0cff-0310-8789-dd5450dbe970
* Purge make targets and variables (and a few files) relating to the old,Ken Raeburn2004-06-172-3/+4
| | | | | | unmaintained Mac OS 9 (and earlier) support. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16473 dc483132-0cff-0310-8789-dd5450dbe970
* * Makefile.in (SHLIB_RDIRS): SetKen Raeburn2004-06-162-0/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16462 dc483132-0cff-0310-8789-dd5450dbe970
* * Makefile.in (SHLIB_DIRS, SHLIB_EXPLIBS, SHLIB_EXPDEPLIBS): Set to depend onKen Raeburn2004-06-153-2/+12
| | | | | | | | the new support library. (SHLIB_LIBS): Don't define. * configure.in: Use BUILD_LIBRARY_WITH_DEPS instead of the no-deps version. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16447 dc483132-0cff-0310-8789-dd5450dbe970
* * yarrow.c (yarrow_str_error): Now constKen Raeburn2004-06-042-1/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16415 dc483132-0cff-0310-8789-dd5450dbe970
* Change all uses of LIB in UNIX makefiles to LIBBASE, for better WindowsKen Raeburn2004-06-042-1/+5
| | | | | | | | | compatibility. (Windows nmake exports make variables into the environment, and LIB is treated by the Windows linker as a search path for libraries, thus breaking the linking on Windows of anything needing libraries from the search path in directories where we build libraries on UNIX.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16411 dc483132-0cff-0310-8789-dd5450dbe970
* * prng.c (init_once): Variable deleted.Ken Raeburn2004-06-022-9/+13
| | | | | | | (krb5_c_random_add_entropy): Do the initialization once, using the yarrow_lock mutex instead of k5_once to protect it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16392 dc483132-0cff-0310-8789-dd5450dbe970
* * yarrow.c (krb5int_yarrow_final): CallEzra Peisach2004-05-264-0/+23
| | | | | | | | | | | | krb5int_yarrow_cipher_final before zeroing out reference to memory. * ycipher.[ch] (krb5int_yarrow_cipher_final): Free CIPHER_CTX memory allocated by krb5int_yarrpw_cipher_init(). These cleanup handlers are now invoked in the library "fini" handlers. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16368 dc483132-0cff-0310-8789-dd5450dbe970
* * aesopt.h (PLATFORM_BYTE_ORDER): Treat _WIN32 as alwaysTom Yu2004-05-252-11/+23
| | | | | | | | | | | little-endian. Default to little-endian if there's no other compile-time way to detect endianness, noting it as a guess. (SAFE_IO): Error out if SAFE_IO is not set and endianness was guessed. ticket: 2564 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16362 dc483132-0cff-0310-8789-dd5450dbe970
* * aes.c (krb5int_aes_encrypt): Signed/unsigned warning fixEzra Peisach2004-05-252-2/+8
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16359 dc483132-0cff-0310-8789-dd5450dbe970
* * t_encrypt.c (compare_results): Declare static.Ezra Peisach2004-05-243-3/+12
| | | | | | | | (main): Free allocated memory before exit. * t_nfold.c (fold_kerberos): Change nbytes argument to unsigned. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16358 dc483132-0cff-0310-8789-dd5450dbe970
* Link test programs against thread support libraryKen Raeburn2004-05-138-13/+33
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16332 dc483132-0cff-0310-8789-dd5450dbe970
* * libk5crypto.exports: Add the DES tables back in; libdes425 uses them directlyKen Raeburn2004-05-132-0/+8
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16326 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Check for endian.h and machine/endian.h.Ken Raeburn2004-05-074-7/+25
| | | | | | | | | | | * aes/aesopt.h (PLATFORM_BYTE_ORDER): Check for _MIPSEB, _MIPSEL. If endian.h or machine/endian.h is available, include it instead of sys/param.h. Don't mess around with multibyte character constants. ticket: 2551 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16323 dc483132-0cff-0310-8789-dd5450dbe970
* * prng.c (krb5int_prng_cleanup): Destroy the mutexKen Raeburn2004-05-012-0/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16294 dc483132-0cff-0310-8789-dd5450dbe970
* * Makefile.in (LIBINITFUNC, LIBFINIFUNC): New variablesKen Raeburn2004-05-012-0/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16292 dc483132-0cff-0310-8789-dd5450dbe970
* update dependenciesKen Raeburn2004-05-012-143/+174
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16291 dc483132-0cff-0310-8789-dd5450dbe970
* Add a mutex for the shared static storage used by YarrowKen Raeburn2004-05-014-44/+89
| | | | | | | | | | | | | | | | | | | | | | | * crypto_libinit.c (initialized): Variable deleted. (cryptoint_initialize_library, cryptoint_cleanup_library): Use new macros for automatic shared library init/fini functions. (prng_cleanup): Declaration deleted. (krb5int_prng_init, krb5int_prng_cleanup): Declare. (cryptoint_initialize_library): Call krb5int_prng_init. (krb5int_crypto_init): New function, checks that cryptoint_initialize_library was called successfully. (cryptoint_cleanup_library): Call krb5int_prng_cleanup only if the initializer ran. * crypto_libinit.h: Deleted. * prng.c: Include k5-thread.h. (init_once, init_error, yarrow_lock): New variables. (krb5int_prng_init): New function; finish initializing the mutex lock. (do_yarrow_init): New function. (krb5_c_random_add_entropy): Call it once only. Lock the mutex before processing the input. (krb5_c_random_make_octets): Lock the mutex before extracting random bytes. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16290 dc483132-0cff-0310-8789-dd5450dbe970
* * libk5crypto.exports: Drop the library init/fini functions and the DES tablesKen Raeburn2004-04-302-5/+5
| | | | | | from the export list. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16288 dc483132-0cff-0310-8789-dd5450dbe970
* update dependenciesKen Raeburn2004-04-2413-155/+169
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16270 dc483132-0cff-0310-8789-dd5450dbe970
* Add files containing the export lists used on UNIX, in each directoryKen Raeburn2004-04-222-0/+157
| | | | | | | | | | | | | | where we build a shared library, whether or not it gets installed. These should match the complete AIX export lists for a full build including krb4 support, and will eventually be used on other UNIX platforms, and cut down to just the symbols we actually want to export. We'll also have to add additional information, eventually, for versioning and such, but currently this is just a list of C symbol names. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16259 dc483132-0cff-0310-8789-dd5450dbe970
* * string2key.c: Replaced with a new implementation.Ken Raeburn2004-04-032-199/+205
| | | | | | (Smaller and faster, at least on gcc for x86.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16227 dc483132-0cff-0310-8789-dd5450dbe970
* * pbkdf2.c (hmac1): Make a local copy of the supplied keyblock structure, inKen Raeburn2004-03-222-0/+8
| | | | | | | | | case we want to modify it. ticket: 2453 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16202 dc483132-0cff-0310-8789-dd5450dbe970
* * t_crc.c (timetest): Free 'block' before returning.Ken Raeburn2004-03-222-1/+7
| | | | | | (verify): Fix minor type error in call to gethexstr. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16197 dc483132-0cff-0310-8789-dd5450dbe970
* * derive.c (krb5_random2key): Don't compile.Ken Raeburn2004-03-183-0/+12
| | | | | | * dk.h (krb5_derive_random): Declare. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16180 dc483132-0cff-0310-8789-dd5450dbe970
* * prng.c (krb5int_prng_cleanup): Renamed from prng_cleanup.Ken Raeburn2004-03-183-2/+10
| | | | | | | * crypto_libinit.c: Include k5-int.h. (cryptoint_cleanup_library): Updated call. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16179 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Don't check for --enable-athena and don't define ↵Ken Raeburn2004-03-042-6/+5
| | | | | | ATHENA_DES3_KLUDGE git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16145 dc483132-0cff-0310-8789-dd5450dbe970
* Remove ENCTYPE_LOCAL_DES3_HMAC_SHA1Sam Hartman2004-02-248-412/+10
| | | | | | | | | | Previously, MIT had support for a version of the des3 enctype with a 32-bit length prepended to encrypted data. Remove that support. This is non-standard and is no longer needed even at MIT. Ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16122 dc483132-0cff-0310-8789-dd5450dbe970