Commit Graph

166 Commits

Author SHA1 Message Date
Love Hörnquist Åstrand
d23858caf2 Use krb5_set_error_message(), drop unused functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23278 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 03:25:46 +00:00
Love Hörnquist Åstrand
b127d90367 use offset to go over the array.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23237 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-01 22:26:24 +00:00
Love Hörnquist Åstrand
e9662cad42 Use wind_utf8ucs2_length to convert the password to utf16.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23236 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-01 22:26:08 +00:00
Love Hörnquist Åstrand
af065bb9b8 Use DES_set_key_unchecked().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23142 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-29 05:47:08 +00:00
Love Hörnquist Åstrand
cc1564ec41 use struct for AlgorithmIdentifier.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22946 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-10 09:47:23 +00:00
Love Hörnquist Åstrand
8e6f72fb92 Check kdf params. calculate the second half of the key.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22939 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-09 13:07:24 +00:00
Love Hörnquist Åstrand
b0bd2f7866 (_krb5_pk_kdf): Check that is sha1 we are using.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22936 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-09 13:07:10 +00:00
Love Hörnquist Åstrand
bf33685d7e Complete _krb5_pk_kdf.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22928 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-09 13:06:35 +00:00
Love Hörnquist Åstrand
05422a8a8a First version of KDF in draft-ietf-krb-wg-pkinit-alg-agility-03.txt.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22926 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-09 13:06:25 +00:00
Love Hörnquist Åstrand
880d4d84f6 Use unsigned where appropriate.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22864 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 18:50:03 +00:00
Love Hörnquist Åstrand
affe01bf0c revert previous patch, the problem is located in the RAND_file_name()
function that will cause recursive nss lookups, can't fix that here.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22200 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-07 13:48:01 +00:00
Love Hörnquist Åstrand
08e19e862a (krb5_generate_random_block): try to avoid the dead-lock in by not
holding the lock while running RAND_file_name. From Hai Zaar.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22193 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-07 02:16:01 +00:00
Love Hörnquist Åstrand
5fed824f37 its vs it\'s etc. From Bjorn Sandell
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22071 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-11-14 20:04:50 +00:00
Love Hörnquist Åstrand
03ad70ea52 (krb5_enctype_to_string): make sure string is NULL on failure.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21947 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-10-04 07:55:54 +00:00
Love Hörnquist Åstrand
777869d68e Check return values from alloc functions. Prompted by patch of Charles Longeau.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21737 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-31 15:49:35 +00:00
Love Hörnquist Åstrand
5bb7b3bc79 (decrypt_internal_derived): make sure length is longer then confounder
+ checksum.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21130 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-18 20:45:21 +00:00
Love Hörnquist Åstrand
bf02504f31 Require the raw key have the correct size and do away with the
minsize.  Minsize was a thing that originated from RC2, but since RC2
is done in the x509/cms subsystem now there is no need to keep that
around.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20981 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-07 20:05:50 +00:00
Love Hörnquist Åstrand
5e5c20fe90 (krb5_crypto_overhead): return static overhead of encryption.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20683 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-05-16 18:28:27 +00:00
Love Hörnquist Åstrand
169143c4ff Always use the RAND_ interface now that hcrypto provides it.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20062 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-30 18:02:21 +00:00
Love Hörnquist Åstrand
57d6ff40d8 Add Kerberos RFC 3961 PRF functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20041 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-23 20:37:12 +00:00
Love Hörnquist Åstrand
adca139b8a macro kcrypto_oid_enc now longer used
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19833 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-11 08:43:13 +00:00
Love Hörnquist Åstrand
4e200bc2d5 Add krb5_enctype_keybits.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19063 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-17 21:58:47 +00:00
Love Hörnquist Åstrand
d2388f8176 Allocate the memory we later use.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18811 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-22 07:32:40 +00:00
Love Hörnquist Åstrand
ac32e3d909 (AES_string_to_key): Try to not leak memory.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18804 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-22 06:50:02 +00:00
Love Hörnquist Åstrand
a3781da599 Remove workaround from when there wasn't always aes.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18456 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-14 09:59:49 +00:00
Love Hörnquist Åstrand
8b1cb25ffc Prefix der primitives with der_.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18455 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-14 09:53:19 +00:00
Love Hörnquist Åstrand
5a4d04ed30 remove aes-192
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17866 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-07-20 21:37:17 +00:00
Love Hörnquist Åstrand
0cc87e8758 Remove more CMS bits.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17865 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-07-20 21:37:16 +00:00
Love Hörnquist Åstrand
fdcc12bca6 Remove CMS symmetric encryption support.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17859 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-07-20 10:57:44 +00:00
Love Hörnquist Åstrand
464d720b1c Catches both keyed checkout w/o crypto context cases and doesn't reset
the string, and corrects the grammar.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17514 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-08 13:47:24 +00:00
Love Hörnquist Åstrand
a6dbbc8629 Drop aes-cbc, rc2 and CMS padding support, its all containted in
libhcrypto and libhx509 now.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17513 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-08 13:45:28 +00:00
Love Hörnquist Åstrand
c5a313c313 (create_checksum): provide a error message that a key checksum needs a key.
From Andew Bartlett.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17504 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-07 12:20:30 +00:00
Love Hörnquist Åstrand
348b5d79c4 Rename u_intXX_t to uintXX_t
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17442 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-05 09:31:15 +00:00
Love Hörnquist Åstrand
2a7b485275 (krb5_string_to_key_derived): deref after NULL check.
Coverity NetBSD CID#2367


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17034 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-10 08:58:53 +00:00
Love Hörnquist Åstrand
203072d917 (decrypt_*): handle the case where the plaintext is 0 bytes long,
realloc might then return NULL.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16787 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-07 19:34:55 +00:00
Love Hörnquist Åstrand
d86be025ae (AES_string_to_key): drop _krb5_PKCS5_PBKDF2 and use PKCS5_PBKDF2_HMAC_SHA1
instead.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16781 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-02-28 14:52:57 +00:00
Love Hörnquist Åstrand
5cebb7986f (krb5_generate_random_block): check return value from RAND_bytes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16748 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-02-16 10:10:59 +00:00
Love Hörnquist Åstrand
eb0369c938 (krb5_derive_key): Free more of the allocated memory, this function is
only used by the test program.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16343 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-12-02 14:47:44 +00:00
Love Hörnquist Åstrand
ce7c2af147 (krb5_DES_string_to_key): If the opaque length it set to 1, and
content is 0x01, use the afs3 string-to-key.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16078 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-09-19 22:13:54 +00:00
Love Hörnquist Åstrand
a15603afa7 (_krb5_pk_octetstring2key): make sha1 output unsigned char to match openssl
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15681 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-20 07:22:43 +00:00
Love Hörnquist Åstrand
cba53a17f2 (_krb5_pk_octetstring2key): fix arguments
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15628 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-12 22:29:52 +00:00
Love Hörnquist Åstrand
a70cf1c3a6 (_krb5_pk_octetstring2key): string2key function used in pk-init-25
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15622 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-12 13:34:47 +00:00
Love Hörnquist Åstrand
3283e2cb08 make input data to krb5_encrypt{,_ivec} const
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15604 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-09 12:33:36 +00:00
Love Hörnquist Åstrand
1f25cc530f (wrapped_length): the underived encrypted types checksum are all
unkeyed (matches the code in encrypt_internal() and
encrypt_internal_special())


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15598 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-09 01:35:31 +00:00
Love Hörnquist Åstrand
1dcdb9c1a0 optionally compile in support for string2key
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15527 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-06-29 22:20:33 +00:00
Love Hörnquist Åstrand
85588d6046 (krb5_string_to_key): unconst password
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15479 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-06-17 05:03:45 +00:00
Love Hörnquist Åstrand
d83bcde1e8 rename `encrypt' to avoid shadow warning
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15462 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-06-16 22:54:33 +00:00
Love Hörnquist Åstrand
9b38bf74d1 Don't declare des_salt &c as static with incomplete type (invalid in
c89, at least).


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15053 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-02 14:11:59 +00:00
Love Hörnquist Åstrand
f8c1fbfbe4 unexport the oid_to_enctype function, not for external consumers
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14921 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-04-24 14:14:17 +00:00
Love Hörnquist Åstrand
e502ee6379 AES is enabled by default, remove ifdefs
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14654 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-03-17 00:42:05 +00:00