Commit Graph

39 Commits

Author SHA1 Message Date
Luke Howard 9d98ce72ff krb5: fix const warning in krb5_c_verify_checksum() 2018-12-21 15:47:20 +11:00
Stefan Metzmacher 6fa09c001f lib/krb5: use krb5_verify_checksum() in krb5_c_verify_checksum()
This allows the optimized checksum->verify() function to be used.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from Samba commit fb318ab0203297019c5e47c6bef4a9abfdeea8a5)
2017-10-11 12:51:56 -05:00
Mikhail T 9f6baf00f6 lib/krb5: Implement krb5_c_random_make_octets correctly
The function, found in lib/krb5/mit_glue.c, is currently using
krb5_generate_random_keyblock(). This compiles because warning-level is
not high enough, but does not work. At runtime the
krb5_generate_random_keyblock() interprets the second argument as the
krb5_enctype (rather than a length of anything) and tries to verify it.

When the length does not match any known enctype, as usually happens, the
function fails and returns an error. If the length happened to correspond
to an enctype, the function would likely crash due to misinterpreting its
third argument as a valid krb5_keyblock.

The change uses krb5_generate_random_block() instead. This function does
not return anything -- upon detecting failure it will cause the entire
application to exist instead...

Change-Id: I865a360037a513ce91abc7abba1dc554f844b464
2016-06-18 17:35:16 -04:00
Roland C. Dowdeswell f0f07ff408 Use krb5_enomem() more consistently in lib/krb5. 2013-02-13 16:15:00 +08:00
Roland C. Dowdeswell 3ef06de67b Fix a couple of bugs in krb5_c_valid_enctype():
1.  on errors, it appears to core dump, and

      2.  the sense of the return code is inverted from the
          MIT implementation.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-07-19 21:25:15 -07:00
Love Hornquist Astrand 0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand 305596d9ad Rename subsystem_DEPRECATED to subsystem_DEPRECATED_FUNCTION(X)
Start to explain what the replacement function is.
Generate the #define/#undef logic in generated header files.
Use gcc style where the deprecation warning is after the prototype.
2011-05-17 23:12:51 -07:00
Asanka C. Herath 7569337e9f Windows: Move cache specific code out of mit_glue.c
Move code for checking backwards compatible configuration file location into cache.c.  Also use registry handling code from config_reg.c.
2010-11-24 15:32:41 -05:00
Asanka C. Herath 00ba841893 Windows: Use backwards compatible registry key for default cache
On Windows, existing applications determine and change the default
credentials cache using the Kerberos for Windows registry key
(\Software\MIT\Kerberos5, ccname).  Use it for backwards
compatibility.
2010-11-24 15:32:34 -05:00
Love Hornquist Astrand 2d1ca83efa use krb5_data_ct_cmp 2010-11-06 20:52:33 +01:00
Asanka Herath b3797f428b Add krb5_c_random_make_octets() to mit_glue.c 2010-09-14 08:04:19 -04:00
Asanka Herath e447009d1b Add krb5_free_default_realm() to MIT glue 2010-09-14 08:04:18 -04:00
Asanka Herath c93c2c72be Additional MIT glue
Add compatible exports for:

krb5_auth_con_getsendsubkey()
krb5_auth_con_getrecvsubkey()
krb5_auth_con_setsendsubkey()
krb5_auth_con_setrecvsubkey()
2010-09-14 08:04:14 -04:00
Love Hornquist Astrand 332f988737 make verify checksum ct 2010-01-01 13:09:22 +01:00
Love Hornquist Astrand 687db64c56 Patch from Secure Endpoints/Asanka Herath for windows support 2009-12-21 08:45:28 +01:00
Love Hornquist Astrand 94b702e938 deprecated warning 2009-11-22 16:10:25 -08:00
Love Hörnquist Åstrand 942a821fab remove RCSID
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25171 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-04 06:17:40 +00:00
Love Hörnquist Åstrand 607f562551 define KRB5_DEPRECATED
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25163 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-28 21:09:59 +00:00
Love Hörnquist Åstrand ba32ee19dc move krb5_cc_copy_creds here
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25010 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 03:57:37 +00:00
Love Hörnquist Åstrand 0185f209ea define
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24310 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-11 21:53:25 +00:00
Love Hörnquist Åstrand bbf2135459 syntax
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24309 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-11 21:53:15 +00:00
Love Hörnquist Åstrand c612b77ad1 cheat for krb5_c_enctype_compare() and make it as KRB5_DEPRECATED
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24308 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-11 21:53:06 +00:00
Love Hörnquist Åstrand 318bc750f8 krb5_enctypes_compatible_keys and krb5_c_enctype_compare deprecated
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24072 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-11 04:53:26 +00:00
Love Hörnquist Åstrand 17d061ec36 heimdal smaller
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23967 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-26 18:22:38 +00:00
Love Hörnquist Åstrand 6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand 5214f4a50a Add MIT glue for Kerberos RFC 3961 PRF functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20042 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-23 20:37:43 +00:00
Love Hörnquist Åstrand e299db5039 (krb5_c_keylengths): make compile again.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19067 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-17 22:17:46 +00:00
Love Hörnquist Åstrand 0afc3bb28a (krb5_c_keylengths): rename.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19065 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-17 22:06:07 +00:00
Love Hörnquist Åstrand 3719ad0089 (krb5_c_keylength): mit changed the api, deal.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19064 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-17 22:04:54 +00:00
Love Hörnquist Åstrand 6326a9272e Add krb5_c_keylength.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18966 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-09 21:24:16 +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 e84fad2e0e zero out content of all krb5_free_x_content like functions to make sure data doesnt get reused, idea from Wynn Wilkes <wwilkes@vintela.com>
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15167 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-18 04:21:57 +00:00
Love Hörnquist Åstrand 91351971f7 add KRB5_LIB_FUNCTION to all exported functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13863 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-05-25 21:46:46 +00:00
Love Hörnquist Åstrand aa10794d91 add some more krb5_c functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12482 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-07-22 10:23:28 +00:00
Love Hörnquist Åstrand b96d3e3b50 (krb5_c_get_checksum): make type and data argument optional
(krb5_c_{encrypt,decrypt}): return "better" error codes for invalid ivec length


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12478 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-07-21 21:16:26 +00:00
Love Hörnquist Åstrand 150ffb9adb support passing in NULL as the cipher_state/ivec
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12453 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-07-19 07:40:53 +00:00
Love Hörnquist Åstrand 144d4010c3 first version of krb5_c encryption glue
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12448 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-07-18 22:00:21 +00:00
Love Hörnquist Åstrand 2271516668 add compat mit krb5_c checksum related functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12113 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-04-23 17:34:57 +00:00