Commit Graph

57 Commits

Author SHA1 Message Date
Volker Lendecke
f4faaeaba3 heimdal: Fix the 32-bit build on FreeBSD
Format string fixes that fail in the Samba build on a 32-bit machine

Signed-off-by: Volker Lendecke <vl@samba.org>
2022-11-16 23:46:46 -05:00
Nicolas Williams
1cede09a0b krb5: Add support for AD-KDC-ISSUED 2022-01-01 23:30:15 -06:00
Nicolas Williams
87f8c0d2b5 krb5: Add name attributes to krb5_principal
We now have what we need in krb5_principal to implement much of RFC6680.
Now we populate those fields so that they can be accessed by GSS-API
RFC6680 name attributes functions.

The next commit should add much of the GSS-API RFC6680 name attributes
functions and functionality.
2022-01-01 23:30:15 -06:00
Luke Howard
f538f0e5c2 krb5: use new krb5_time_abs() function
From Apple Heimdal-597.121.1: replace calls to labs() with krb5_time_abs()
2021-08-09 21:46:39 +10:00
Nicolas Williams
94bf464f8d krb5: Add krb5_ticket_get_times() 2019-11-02 18:49:42 -05:00
Viktor Dukhovni
fae8df3839 Optional backwards-compatible anon-pkinit behaviour
* Anonymous pkinit responses from the KDC where the name
  type is not well-known (as issued by 7.5 KDCs and earlier)
  are accepted by the client.  There is no need for the client
  to strictly enforce the name type.

* With historical_anon_pkinit = true, the kinit(1) client's
  "--anonymous" option only performs anon pkinit, and does
  not require an '@' prefix for the realm argument.

* With historical_anon_realm = true, the KDC issues anon
  pkinit tickets with the legacy pre-7.0 "real" realm.
2019-09-04 18:00:15 -04:00
Luke Howard
014e318d6b krb5: check KDC supports anonymous if requested
Verify the KDC recognized the request-anonymous flag by validating the returned
client principal name.
2019-05-18 20:31:52 -04:00
Jeffrey Altman
bdcd7d2f3d krb5_principal_is_anonymous
_krb5_principal_is_anonymous() is used outside lib/krb5 and
therefore it needs to be properly exported and its flag macros
need to be in a public header: krb5.h not krb5_locl.h.

Including krb5_locl.h from within kuser_locl.h for instance
results in build failures on Solaris.

This change renames the function and makes it part of the public
api.

Change-Id: I130d1698b10bdbd150b95e8c7d32dfc362889ce6
2019-05-16 16:23:20 +10:00
Luke Howard
bcc90f1b87 krb5: _krb5_principal_is_anonymous() helper API
Add _krb5_principal_is_anonymous() private API for checking if a principal is
anonymous or not. The third argument determines whether to match authenticated
anonymous, unauthenticated anonymous, or both types of principal.
2019-05-14 15:16:19 -04:00
Luke Howard
55ee6c1282 krb5: support for anonymous TGS requests
Add support to krb5_get_creds() for requesting anonymous service tickets using
a TGT, using the flag KRB5_GC_ANONYMOUS.
2019-05-14 15:16:19 -04:00
Matt Selsky
37979747bc Fix subject verb agreement in error message...
for krb5_ticket_get_authorization_data_type()

And remove FIXME in translation files.

Fix heimdal#361
2018-03-09 17:04:29 -05:00
Jeffrey Altman
6dd3eb836b CVE-2017-11103: Orpheus' Lyre KDC-REP service name validation
In _krb5_extract_ticket() the KDC-REP service name must be obtained from
encrypted version stored in 'enc_part' instead of the unencrypted version
stored in 'ticket'.  Use of the unecrypted version provides an
opportunity for successful server impersonation and other attacks.

Identified by Jeffrey Altman, Viktor Duchovni and Nico Williams.

Change-Id: I45ef61e8a46e0f6588d64b5bd572a24c7432547c
2017-07-10 16:51:25 -04:00
Nicolas Williams
b4cf4de807 Fix warnings (clang 3.6) 2016-02-26 01:04:31 -06:00
Andrew Bartlett
29f6290fe6 lib/krb5: Remove KRB5_PADATA_CLIENT_CANONICALIZED from ticket.c
This will shortly be removed from krb5.asn1.

This got removed between draft-ietf-krb-wg-kerberos-referrals-11.txt
    and the final rfc6806.txt.

    The number 133 was reassigned to PA-FX-COOKIE in rfc6113.txt.

Andrew Bartlett based on work by metze to remove it from othert parts of the code

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-06-17 17:41:27 -05:00
Love Hornquist Astrand
d41f005cc1 add _krb5_get_ad 2013-07-16 14:57:03 +02:00
Jeffrey Altman
5f138a16ef libkrb5: Add missing KRB5_LIB_FUNCTION/KRB5_LIB_CALL
KRB5_LIB_FUNCTION and KRB5_LIB_CALL are necessary even on private
functions that are exported.

Change-Id: Iccd0cfe87ff0a9d851e29890e9cb55b3ae517ce1
2013-06-22 21:17:32 -04:00
Roland C. Dowdeswell
f0f07ff408 Use krb5_enomem() more consistently in lib/krb5. 2013-02-13 16:15:00 +08:00
Love Hornquist Astrand
a01520cb50 validate KRB5_PADATA_REQ_ENC_PA_REP 2011-07-24 20:24:38 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Jeffrey Altman
6850d6a65f avoid uninit variable and unreachable code warnings
most of these warnings are not problems because of ample
use of abort() calls.  However, the large number of warnings
makes it difficult to identify real problems.  Initialize
the variables to shut up the compilers.

Change-Id: I8477c11b17c7b6a7d9074c721fdd2d7303b186a8
2011-05-17 12:02:16 -04:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Asanka C. Herath
0f853405fe Add missing export and calling convention annotations 2010-11-24 15:32:49 -05:00
Asanka Herath
5dcc605f6b Fix calling conventions for Windows 2010-08-20 13:14:10 -04:00
Love Hornquist Astrand
ae74dc7316 allow a cross realm ticket returned in the non referrals case 2010-03-07 01:02:02 -08: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
faa82b3890 support EXTRACT_TICKET_TIMESYNC 2009-11-22 12:22:59 -08:00
Love Hornquist Astrand
940f050300 doxygen 2009-08-29 01:26:16 -07: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
f002e0df4c move _krb5_extract_ticket here
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24295 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-11 21:50:59 +00:00
Love Hörnquist Åstrand
03babea1e3 switch to krb5_clear_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23911 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-14 02:55:39 +00:00
Love Hörnquist Åstrand
c247506e8e make krb5_ticket_get_flags compile
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23898 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-13 03:01:53 +00:00
Love Hörnquist Åstrand
1ec61c11cf add krb5_ticket_get_flags
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23895 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-13 03:01:19 +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
5fa336aac7 make compile again
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23807 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:36:54 +00:00
Love Hörnquist Åstrand
250ee44a09 N_()ify
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23806 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:36:39 +00:00
Love Hörnquist Åstrand
8967bd794e N_()ify
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23805 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:36:24 +00:00
Love Hörnquist Åstrand
32d7980f02 use krb5_set_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23310 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 03:30:49 +00:00
Love Hörnquist Åstrand
dac3a0a031 Cast krb5_error_code to int to avoid warning.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22993 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-15 15:55:30 +00:00
Love Hörnquist Åstrand
7997ff4d88 add krb5_ticket_get_endtime
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19544 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-28 20:49:18 +00:00
Love Hörnquist Åstrand
d3938b5abb (krb5_ticket_get_authorization_data_type): unbreak.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18923 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-06 17:57:18 +00:00
Love Hörnquist Åstrand
7dc5946f3c Fix extraction of authz data from the AuthorizationData sequence:
Where we had
 IF-RELEVENT::
	WIN2K-PAC
 IF-RELEVENT::
	SIGNED-PATH

The recursion into find_type_in_ad() for the second element would set
ret = ENOENT, and therefore the tail would set *found = FALSE, despite
the data already being found.

From Andrew Bartlett


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18922 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-06 17:53:58 +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
881e730620 Spelling.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16248 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-10-27 13:21:42 +00:00
Love Hörnquist Åstrand
9b2fa77b4d (krb5_ticket_get_authorization_data_type): understand
KRB5_AUTHDATA_IF_RELEVANT and KRB5_AUTHDATA_AND_OR (but have
KRB5_AUTHDATA_KDC_ISSUED commented out for now)


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16247 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-10-27 13:18:25 +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
57075c968c (krb5_ticket_get_authorization_data_type): add error strings
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13708 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-04-13 12:35:56 +00:00
Love Hörnquist Åstrand
3d146065c3 (krb5_free_ticket): free the ticket itself to match mit behavior,
pointed out by Derrick Brashear


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13102 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-11-09 00:53:12 +00:00
Love Hörnquist Åstrand
a3af14abf9 (krb5_ticket_get_authorization_data_type): reindent
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12711 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-08-31 19:32:57 +00:00
Love Hörnquist Åstrand
0c533c290e fix spelling in last commit
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12710 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-08-31 14:51:06 +00:00