summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/krb
Commit message (Collapse)AuthorAgeFilesLines
...
* Initialize hash_iov, in case of premature error exitKen Raeburn2009-12-311-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23551 dc483132-0cff-0310-8789-dd5450dbe970
* Combine the related code into one fileZhanna Tsitkov2009-12-295-143/+55
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23537 dc483132-0cff-0310-8789-dd5450dbe970
* fast negotiation projecSam Hartman2009-12-141-0/+8
| | | | | | | | | | | | | | | | Merge branches/fast-negotiate into trunk. This implements http://k5wiki.kerberos.org/wiki/Projects/Fast_negotiation Additional changes: * krb5_c_make_checksum with checksum type 0 uses mandatory checksum for given key enctype Conflicts: src/lib/crypto/krb/make_checksum.c ticket: 6595 Tags: enhancement git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23465 dc483132-0cff-0310-8789-dd5450dbe970
* Don't use sizeof(pointertype) to get the length of an allocated arrayTom Yu2009-12-101-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23464 dc483132-0cff-0310-8789-dd5450dbe970
* Add comments to make it slightly clearer howGreg Hudson2009-12-101-1/+2
| | | | | | krb5int_confounder_checksum works. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23463 dc483132-0cff-0310-8789-dd5450dbe970
* Restructure the crypto checksum implementation to minimizeGreg Hudson2009-12-1031-1199/+693
| | | | | | | | | | | | | | | | | | | | | dependencies on the internals of modules. * Keyhash providers are gone. * The cksumtypes table contains checksum and verify functions, similar to the etypes encrypt and decrypt functions. New checksum functions parallel the old keyhash providers, and there are also functions for unkeyed and derived-key HMAC checksums. * The flags field is now used to indicate whether a checksum is unkeyed, but not whether it is a derived-key HMAC checksum. * The descbc checksum is handled through a new enc_provider function which calculates a CBC MAC. The OpenSSL module does not implement the CBC MAC function (it didn't implement descbc before). builtin/des could probably get rid of f_cksum.c (the old DES CBC routine) with some alterations to string2key.c. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23462 dc483132-0cff-0310-8789-dd5450dbe970
* Remove the ivec parameters from the keyhash provider functions, asGreg Hudson2009-12-069-25/+19
| | | | | | they are never used by callers. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23452 dc483132-0cff-0310-8789-dd5450dbe970
* Make the libk5crypto hash_provider interface take crypto_iov listsGreg Hudson2009-12-0614-227/+115
| | | | | | | instead of lists of krb5_data. Make the base HMAC APIs take crypto_iov lists and drop the _iov variants. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23450 dc483132-0cff-0310-8789-dd5450dbe970
* Remove some code paths in crypto-length which are dead now that theGreg Hudson2009-12-041-11/+2
| | | | | | internal interface can't return an error. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23446 dc483132-0cff-0310-8789-dd5450dbe970
* Remove CRC32_SHIFT4 code as we are unlikely to ever need itGreg Hudson2009-12-042-32/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23445 dc483132-0cff-0310-8789-dd5450dbe970
* Consolidate the IOV and non-IOV encryption/decryption code paths, andGreg Hudson2009-12-0450-2160/+646
| | | | | | | | | | | | | | | | | | | | | | | | drop the _iov suffix from most encryption- and decryption-related functions. The enc_provider encrypt and decrypt functions take IOVs, as do the enctype entries in etypes.c, and there are no separate encrypt_iov or decrypt_iov functions. aead_provider is gone. Enctype functions now take pointers to the enctype entry instead of pointers to the enc/hash/aead providers; this allows dk_encrypt and dk_decrypt to be polymorphic in the length function they use now that AES and DES3 can't differentiate by aead provider. aes_string_to_key needed to be moved into the krb/ fold for this since it's an enctype function; it was duplicated between builtin/ and openssl/ before. This leaves openssl/aes empty; the build system currently demands that all modules have the same directory structure, so the directory and Makefile will stick around for now. Three separate copies of the derive_random logic are also now consolidated into one. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23444 dc483132-0cff-0310-8789-dd5450dbe970
* update dependenciesKen Raeburn2009-12-023-17/+31
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23433 dc483132-0cff-0310-8789-dd5450dbe970
* Speed up the per-block loops of AES, DES3, and DES IOV encryption byGreg Hudson2009-12-022-1/+49
| | | | | | | | | avoiding function calls and copies in the case where the next block is wholly contained within the current buffer. To do this, introduce two new inline functions in aead.h called iov_next_block and iov_store_block. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23430 dc483132-0cff-0310-8789-dd5450dbe970
* Fix an incorrect length in the new krb5int_c_decrypt_aead_compatGreg Hudson2009-12-021-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23426 dc483132-0cff-0310-8789-dd5450dbe970
* Fix AES IOV decryption of small messagesGreg Hudson2009-12-011-13/+8
| | | | | | | | | | | | | AES messages never need to be padded because the confounder ensures that the plaintext is at least one block long. Remove a check in krb5int_dk_decrypt_iov which was rejecting short AES messages because it didn't count the header length. ticket: 6589 tags: pullup target_version: 1.7.1 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23397 dc483132-0cff-0310-8789-dd5450dbe970
* Make krb5int_c_decrypt_aead_compat more efficient by building theGreg Hudson2009-12-011-23/+41
| | | | | | | buffers explicitly rather than using stream decryption. Sidesteps some machinery and avoids copying the output. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23396 dc483132-0cff-0310-8789-dd5450dbe970
* Fix the usage fallback in krb5int_arcfour_decrypt_iov. Factor out IOVGreg Hudson2009-12-011-25/+29
| | | | | | | encryption with a keyblock since this makes four uses of it in one file. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23395 dc483132-0cff-0310-8789-dd5450dbe970
* Remove some stray tabsGreg Hudson2009-11-301-4/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23391 dc483132-0cff-0310-8789-dd5450dbe970
* Use aead_dk instead of aead_old for des-hmac-sha1, since it usesGreg Hudson2009-11-301-1/+1
| | | | | | dk_encrypt. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23390 dc483132-0cff-0310-8789-dd5450dbe970
* Add an AEAD provider for enctypes which use krb5_old_encrypt andGreg Hudson2009-11-306-17/+245
| | | | | | | | | krb5_old_decrypt; this makes every enctype have an AEAD provider. To make this work, expose make_unkeyed_checksum_iov to other files (under the name krb5int_hash_iov) and make krb5int_c_padding_length take into account the header length. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23388 dc483132-0cff-0310-8789-dd5450dbe970
* Make the crc32 hash provider correctly chain multiple input buffers,Greg Hudson2009-11-302-2/+3
| | | | | | | | so that it returns the same result if you pass it one big buffer or many small buffers containing the same data. To do this, change the contract of mit_crc32 so that the cksum parameter is in-out. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23386 dc483132-0cff-0310-8789-dd5450dbe970
* Stream decryption is handled in krb5_k_decrypt_iov; remove someGreg Hudson2009-11-302-12/+0
| | | | | | | lingering checks in the dk and raw aead providers from before that was introduced. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23385 dc483132-0cff-0310-8789-dd5450dbe970
* Remove the non-iov entry point introduced in r23378, since it's easyGreg Hudson2009-11-292-49/+3
| | | | | | | | to use the iov entry point at both call sites. Rename the iov entry point to remove the "_iov" suffix since it's no longer needed to disambiguate. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23381 dc483132-0cff-0310-8789-dd5450dbe970
* Avoid using strncpy in the production of the arcfour salt because itGreg Hudson2009-11-291-4/+3
| | | | | | | produces a (spurious) Coverity defect. Fix a memory leak in krb5int_arcfour_encrypt. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23380 dc483132-0cff-0310-8789-dd5450dbe970
* Create functional internal interfaces to allow GSSAPI to performGreg Hudson2009-11-283-2/+94
| | | | | | | | arcfour encryption of GSS tokens. This factors out derivation of the usage and encryption keys, and removes the need for the provider structures to be visible to all of krb5 via k5-int.h. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23378 dc483132-0cff-0310-8789-dd5450dbe970
* Clean up the arcfour token encryption and decryption functions byGreg Hudson2009-11-283-404/+272
| | | | | | | making use of newer convenience functions and by factoring out the derivation of the usage and encryption keys. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23377 dc483132-0cff-0310-8789-dd5450dbe970
* Mark and reindent lib/cryptoGreg Hudson2009-11-2889-2311/+2390
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23374 dc483132-0cff-0310-8789-dd5450dbe970
* Allow null keys to be referenced (a no-op) for simpler "copying" ofGreg Hudson2009-11-271-1/+2
| | | | | | | keys which might or might not exist. Consistent with allowing freeing of null keys. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23371 dc483132-0cff-0310-8789-dd5450dbe970
* Move the arcfour directory from the crypto module dirs into krb. ThisGreg Hudson2009-11-2711-17/+898
| | | | | | | | | | | | | directory contains the token encryption code (similar to dk, old, and raw) which is Kerberos-specific. The actual stream cipher lives in enc_provider/rc4.c, which is still in the module dirs. arcfour/arcfour-int.h contained the definitions of some structures used only in enc_provider/rc4.c. Move those definitions into that source file so that everything in arcfour is at the right level of abstraction to live in krb. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23367 dc483132-0cff-0310-8789-dd5450dbe970
* Add krb5_k_prf, the krb5_key version of krb5_c_prfGreg Hudson2009-11-271-4/+14
| | | | | | ticket: 6576 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23365 dc483132-0cff-0310-8789-dd5450dbe970
* Pullup to 1.7-branch is only for the test case, as krb5-1.7 behavedTom Yu2009-11-262-14/+90
| | | | | | | | | | | | | | | | | | correctly for these checksums. Fix regression in MD4-DES and MD5-DES keyed checksums. The original key was being used for the DES encryption, not the "xorkey". (key with each byte XORed with 0xf0) Add a test case that will catch future regressions of this sort, by including a verification of a "known-good" checksum (derived from a known-to-be-interoperable version of the implementation). ticket: 6584 target_version: 1.7.1 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23361 dc483132-0cff-0310-8789-dd5450dbe970
* Consolidate Makefile variables now that we have only a single globalGreg Hudson2009-11-2218-545/+528
| | | | | | | | | | | | | configure script: $(SRCTOP) --> $(top_srcdir) $(srcdir)/$(thisconfigdir) --> $(top_srcdir) $(thisconfigdir) --> $(BUILDTOP) $(myfulldir) --> $(mydir) ticket: 6583 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23308 dc483132-0cff-0310-8789-dd5450dbe970
* Clean up some open-parenthesis problems, and reindentTom Yu2009-11-161-1/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23246 dc483132-0cff-0310-8789-dd5450dbe970
* Typo fixZhanna Tsitkov2009-11-161-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23238 dc483132-0cff-0310-8789-dd5450dbe970
* Remove unreferred krb5int_keyhash_aescbc_xxx. Cleaner ↵Zhanna Tsitkov2009-11-162-2/+2
| | | | | | krb5int_keyhash_md5_hmac init git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23237 dc483132-0cff-0310-8789-dd5450dbe970
* Remove src/lib/crypto/krb/enc_provider, which was accidentallyGreg Hudson2009-11-107-1210/+0
| | | | | | | resurrected (again) in r22875 when merging the authdata branch to the trunk. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23146 dc483132-0cff-0310-8789-dd5450dbe970
* Clean up a bunch of signed/unsigned comparison warningsGreg Hudson2009-11-022-4/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23120 dc483132-0cff-0310-8789-dd5450dbe970
* Move the implementations of four deprecated crypto functions toGreg Hudson2009-11-015-24/+42
| | | | | | | | old_api_glue.c. Move the prototypes of seven deprecated crypto functions to old_api_glue.c instead of k5-int.h, since we don't use those functions internally. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23112 dc483132-0cff-0310-8789-dd5450dbe970
* make mark-cstyleTom Yu2009-10-3185-348/+321
| | | | | | make reindent git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
* Rename some lingering krb5_derive_key referencesGreg Hudson2009-10-292-2/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23086 dc483132-0cff-0310-8789-dd5450dbe970
* Replace krb5_ with krb5Int_ prefix for non-API functionsZhanna Tsitkov2009-10-2839-175/+185
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23079 dc483132-0cff-0310-8789-dd5450dbe970
* with an uninitialized entry on error exitEzra Peisach2009-10-271-0/+1
| | | | | | k5_hmac_md5_hash_iov: Initialize keyblock.length - so we do not invoke zapfree git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23059 dc483132-0cff-0310-8789-dd5450dbe970
* make dependTom Yu2009-10-252-2/+14
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23030 dc483132-0cff-0310-8789-dd5450dbe970
* In k5_hmac_md5_hash_iov, initialize keyblock.contents so that we don'tGreg Hudson2009-10-201-0/+2
| | | | | | free it prior to initialization if krb5_hmac fails. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22953 dc483132-0cff-0310-8789-dd5450dbe970
* In krb5_k_make_checksum, check for a null key passed with a keyedGreg Hudson2009-10-201-1/+1
| | | | | | checksum instead of just crashing. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22952 dc483132-0cff-0310-8789-dd5450dbe970
* Include des_int.h for mit_des_fixup_key_parity prototypeEzra Peisach2009-10-201-0/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22950 dc483132-0cff-0310-8789-dd5450dbe970
* Fix memory leaks in enc-perf workGreg Hudson2009-10-201-0/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22949 dc483132-0cff-0310-8789-dd5450dbe970
* Implement new APIs to allow improved crypto performanceGreg Hudson2009-10-1941-302/+622
| | | | | | | | | | | Merge branches/enc-perf to trunk. Adds the krb5_key opaque type, the krb5_k_* APIs to use them, and caching of derived keys when krb5_k_* functions are used. Updates the krb5 auth context and GSS id-rec to use krb5_keys. ticket: 6576 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22944 dc483132-0cff-0310-8789-dd5450dbe970
* Include des_int.h for mit_des_fixup_key_parity prototype. Adjust Makefile.inEzra Peisach2009-10-182-1/+2
| | | | | | to find the proper header. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22912 dc483132-0cff-0310-8789-dd5450dbe970
* Move destest to builtin/des, because it depends on overriding someTom Yu2009-10-109-235/+277
| | | | | | | | internals. Make depend. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22877 dc483132-0cff-0310-8789-dd5450dbe970