<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Heimdal</title>
	<atom:link href="http://www.h5l.org/blog/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.h5l.org/blog</link>
	<description>The Kerberos 5, PKIX, CMS, GSS-API, SPNEGO, NTLM, Digest-MD5 and, SASL implementation</description>
	<lastBuildDate>Sat, 21 Nov 2009 16:21:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Heimdal 1.3.0 and 1.3.1</title>
		<link>http://www.h5l.org/blog/index.php/2009/11/heimdal-1-3-0-and-1-3-1/</link>
		<comments>http://www.h5l.org/blog/index.php/2009/11/heimdal-1-3-0-and-1-3-1/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 16:21:19 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[Heimdal]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=230</guid>
		<description><![CDATA[It was over a year ago last release was made, today we have published 1.3.1. We already released 1.3.0 last week but was never announced it.
Here is summary of change that included in the release:
Major changes in 1.3.1


Make work with OpenLDAPs krb5 overlay





Major changes in 1.3.0

Partial support for MIT kadmind rpc protocol in kadmind
Better support [...]]]></description>
			<content:encoded><![CDATA[<p>It was over a year ago last release was made, today we have published 1.3.1. We already released 1.3.0 last week but was never announced it.</p>
<p>Here is summary of change that included in the release:</p>
<p><strong>Major changes in 1.3.1</strong></p>
<p><span style="font-family: Tahoma, sans-serif; line-height: 16px; font-size: small;"></p>
<ul>
<li>Make work with OpenLDAPs krb5 overlay</li>
</ul>
<p></span></p>
<p><span style="font-family: Tahoma, sans-serif; line-height: 16px; font-size: small;"></p>
<div class="action unit">
<div id="1.3.0" class="install-description" style="display: block;">
<p><strong>Major changes in 1.3.0</strong></p>
<ul>
<li>Partial support for MIT kadmind rpc protocol in kadmind</li>
<li>Better support for finding keytab entries when using SPN aliases in the KDC</li>
<li>Support BER in ASN.1 library (needed for CMS)</li>
<li>Support decryption in Keychain private keys</li>
<li>Support for new sqlite based credential cache</li>
<li>Try both KDC referals and the common DNS reverse lookup in GSS-API</li>
<li>Fix the KCM to not leak resources on failure</li>
<li>Add IPv6 support to iprop</li>
<li>Support localization of error strings in</li>
<li>kinit/klist/kdestroy and Kerberos library</li>
<li>Remove Kerberos 4 support in application (still in KDC)</li>
<li>Deprecate DES</li>
<li>Support i18n password in windows domains (using UTF-8)</li>
<li>More complete API emulation of OpenSSL in hcrypto</li>
<li>Support for ECDSA and ECDH when linking with OpenSSL</li>
</ul>
</div>
<p>There are more changes in the patch train, and I assume that you all don&#8217;t have to wait other year before 1.4 gets out</p></div>
<p></span></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Release Notes &#8211; Heimdal &#8211; Version Heimdal 1.3.1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Bug fixes</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Make work with OpenLDAPs krb5 overlay</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Release Notes &#8211; Heimdal &#8211; Version Heimdal 1.3</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">New features</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Partial support for MIT kadmind rpc protocol in kadmind</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Better support for finding keytab entries when using SPN aliases in the KDC</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support BER in ASN.1 library (needed for CMS)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support decryption in Keychain private keys</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support for new sqlite based credential cache</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Try both KDC referals and the common DNS reverse lookup in GSS-API</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Fix the KCM to not leak resources on failure</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Add IPv6 support to iprop</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support localization of error strings in</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">kinit/klist/kdestroy and Kerberos library</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Remove Kerberos 4 support in application (still in KDC)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Deprecate DES</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support i18n password in windows domains (using UTF-8)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- More complete API emulation of OpenSSL in hcrypto</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support for ECDSA and ECDH when linking with OpenSSL</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">API changes</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support for settin friendly name on credential caches</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Move to using doxygen to generate documentation.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Sprinkling __attribute__((depricated)) for old function to be removed</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support to export LAST-REQUST information in AS-REQ</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support for client deferrals in in AS-REQ</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Add seek support for krb5_storage.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support for split AS-REQ, first step for IA-KERB</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Fix many memory leaks and bugs</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Improved regression test</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support krb5_cccol</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Switch to krb5_set_error_message</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Support krb5_crypto_*_iov<span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Switch to use EVP for most function</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Use SOCK_CLOEXEC and O_CLOEXEC (close on exec)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Add support for GSS_C_DELEG_POLICY_FLAG</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Add krb5_cc_[gs]et_config to store data in the credential caches</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- PTY testing application</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Bugfixes</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Make building on AIX6 possible.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Bugfixes in LDAP KDC code to make it more stable</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">- Make ipropd-slave reconnect when master down gown</div>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2009/11/heimdal-1-3-0-and-1-3-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using krb5_cc_[gs]et_config</title>
		<link>http://www.h5l.org/blog/index.php/2009/11/using-krb5_cc_gset_config/</link>
		<comments>http://www.h5l.org/blog/index.php/2009/11/using-krb5_cc_gset_config/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 01:44:47 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[Heimdal]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=221</guid>
		<description><![CDATA[Or how everything turned into a nail
Maybe this should be titled, how everything turned into a nail when I got a hammer. There are a couple of use cases I want to discuss first, and then why krb5_cc_[gs]et_config() isn&#8217;t useable for everything.
First out is Windows, you just talked to a Windows AD KDC to get your TGT, but [...]]]></description>
			<content:encoded><![CDATA[<h2>Or how everything turned into a nail</h2>
<p>Maybe this should be titled, how everything turned into a nail when I got a hammer. There are a couple of use cases I want to discuss first, and then why <a href="http://www.h5l.org/blog/index.php/2008/10/the-krb5-cc-gset-config-api/">krb5_cc_[gs]et_config()</a> isn&#8217;t useable for everything.</p>
<p>First out is Windows, you just talked to a Windows AD KDC to get your TGT, but you need to do slight tweeks to make it work better on<br />
Windows, so turn on insecure^HWindows behavior when we use this this credential cache. We make it up with a global setting using krb5_cc_[sg]_config().</p>
<p>Next thing that comes is negative caching of TGS requests (fetching service tickets). Now this seems very stupid to do, but for practical reason is not.</p>
<p>If you want to use <a href="http://www.rfc-editor.org/rfc/rfc4559.txt">HTTP Negotiate</a> and have it default turned on in you http client, you can get bad behaviors in case of the webserver announces support for Negotiate and the client can&#8217;t get service tickets for that realm. You don&#8217;t want to have the performance loss of having to ask the KDC over and over again for the same ticket that you can&#8217;t get.</p>
<p>The the state HTTP negotiate doesn&#8217;t work should probably be in the http client instead, but sometimes that not possible, just think of running <a href="http://curl.haxx.se/">curl</a> in a shell script and looping a couple of times, when you are tired enough of DNS timeouts, not answering KDC, referrals that doesn&#8217;t lead anywhere, etc, you can let me know.</p>
<p>Third problem is ticket forwarding, it will get you into the same problem. If you want to do a lot of forwarding of your ticket, again maybe because of HTTP Negotiate, then you don&#8217;t want to hit the KDC for every request. Again we can use krb5_cc_[gs]et_config to store the<br />
forwarding credential for this entry.</p>
<h2>So when is krb5_cc_[gs]et_config not useful</h2>
<p>So when you renew your credentials you loose all your state, so if you want to keep your state you better store it somewhere else. So that said, having the Windows behavior flag in the krb5_cc_[gs]et_config is probably not good idea. There needs to be somewhere else that this kind of information is stored.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2009/11/using-krb5_cc_gset_config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The use of of gss_accept_sec_context (ASC)</title>
		<link>http://www.h5l.org/blog/index.php/2009/10/the-use-of-of-gss_accept_sec_context-asc/</link>
		<comments>http://www.h5l.org/blog/index.php/2009/10/the-use-of-of-gss_accept_sec_context-asc/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 01:40:40 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[gss-api]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=219</guid>
		<description><![CDATA[This is continuation of the previous article about ISC.
The gssapi function ASC (gss_accept_sec_context) is also complicated,
function, one can argue ASC is simpler then ISC since ASC only takes
11 arguments.
OM_uint32
gss_accept_sec_context
           (OM_uint32 * /*minor_status*/,
            gss_ctx_id_t * [...]]]></description>
			<content:encoded><![CDATA[<p>This is continuation of the <a href="http://www.h5l.org/blog/index.php/2009/09/the-use-of-of-gss_init_sec_context-isc/">previous article about ISC</a>.</p>
<p>The gssapi function ASC (gss_accept_sec_context) is also complicated,<br />
function, one can argue ASC is simpler then ISC since ASC only takes<br />
11 arguments.</p>
<pre>OM_uint32
gss_accept_sec_context
           (OM_uint32 * /*minor_status*/,
            gss_ctx_id_t * /*context_handle*/,
            const gss_cred_id_t /*acceptor_cred_handle*/,
            const gss_buffer_t /*input_token_buffer*/,
            const gss_channel_bindings_t /*input_chan_bindings*/,
            gss_name_t * /*src_name*/,
            gss_OID * /*mech_type*/,
            gss_buffer_t /*output_token*/,
            OM_uint32 * /*ret_flags*/,
            OM_uint32 * /*time_rec*/,
            gss_cred_id_t * /*delegated_cred_handle*/
           );</pre>
<p>Again, just like ISC the main problem is that consumers if this interface tries to pass in too much information, less is usually better.</p>
<h2>Not passing in a credential</h2>
<p>If consumers instead of passing a credential checked the name afterward it would work in more situations. For example, using the GSSAPI Kerberos mech as an acceptor: when the client connects the server doesn&#8217;t know what name the client used, and if the server specifies a credential (thus an implicitly a name) the client have selected another name, ASC will fail.</p>
<p>Do when do server and client not patch up on names ? There are plent of examples, where: HTTP/www, http/www.example.com is the one to start with. Kerberos is case sensitive and client might expect aliases to work.</p>
<h2>The logic flow for ASC</h2>
<p>The flow of a server part of gss-api negotiation looks like this:</p>
<pre>in = null;
do {
   ret = gss_accept_sec_context(in, out);
   if (GSS_ERROR(ret))
      abort();
  send_message(out);
  if (ret == GSS_C_CONTINUE)
      in = read_message();
} while (ret == GSS_C_CONTINUE);

if (check_return_flags())
   abort();

if (check_that_name_is_ok(ctx))
   abort();

/* done */</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2009/10/the-use-of-of-gss_accept_sec_context-asc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross compiling Heimdal</title>
		<link>http://www.h5l.org/blog/index.php/2009/09/cross-compiling-heimdal/</link>
		<comments>http://www.h5l.org/blog/index.php/2009/09/cross-compiling-heimdal/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 09:55:15 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[Heimdal]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=224</guid>
		<description><![CDATA[We got some feedback that it would be good if it was possible to cross compile Heimdal and with some minor works that is now possible.
Its all documented at http://www.h5l.org/compile.html#cross, as usual libtool is somewhat in the way. The current problem that that libtool is not aware of the target&#8217;s build environment, but it seems [...]]]></description>
			<content:encoded><![CDATA[<p>We got some <a href="http://article.gmane.org/gmane.comp.encryption.kerberos.heimdal.general/4782">feedback</a> that it would be good if it was possible to cross compile Heimdal and with some minor works that is now possible.</p>
<p>Its all documented at <a href="http://www.h5l.org/compile.html#cross">http://www.h5l.org/compile.html#cross</a>, as usual libtool is somewhat in the way. The current problem that that libtool is not aware of the target&#8217;s build environment, but it seems to work anyway. Oh well.</p>
<p>The code is all patch of master and will be in the soon to be release Heimdal 1.3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2009/09/cross-compiling-heimdal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The use of of gss_init_sec_context (ISC)</title>
		<link>http://www.h5l.org/blog/index.php/2009/09/the-use-of-of-gss_init_sec_context-isc/</link>
		<comments>http://www.h5l.org/blog/index.php/2009/09/the-use-of-of-gss_init_sec_context-isc/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 20:02:58 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[gss-api]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=213</guid>
		<description><![CDATA[ISC
Lets start to dissect some of the GSS-API functions, first out in gss_init_sec_context (ISC for short).
The gssapi function ISC is a very complicated function, just look at the 13 arguments it takes, and for every round its call in an authentication some of them need to be same, and some need to change.
OM_uint32
gss_init_sec_context
    [...]]]></description>
			<content:encoded><![CDATA[<h2>ISC</h2>
<p>Lets start to dissect some of the GSS-API functions, first out in gss_init_sec_context (ISC for short).</p>
<p>The gssapi function ISC is a very complicated function, just look at the 13 arguments it takes, and for every round its call in an authentication some of them need to be same, and some need to change.</p>
<pre>OM_uint32
gss_init_sec_context
           (OM_uint32 * /*minor_status*/,
            const gss_cred_id_t /*initiator_cred_handle*/,
            gss_ctx_id_t * /*context_handle*/,
            const gss_name_t /*target_name*/,
            const gss_OID /*mech_type*/,
            OM_uint32 /*req_flags*/,
            OM_uint32 /*time_req*/,
            const gss_channel_bindings_t /*input_chan_bindings*/,
            const gss_buffer_t /*input_token*/,
            gss_OID * /*actual_mech_type*/,
            gss_buffer_t /*output_token*/,
            OM_uint32 * /*ret_flags*/,
            OM_uint32 * /*time_rec*/
           );</pre>
<p>In that 13 that lays the confusion, to make make ISC work you only need to pass in 7 arguments, you can leave the other 6 to a default values, in fact, this will probably make it work better in most cases.</p>
<pre>gss_init_sec_context(&amp;minor_status, GSS_C_NO_CREDENTIAL, &amp;ctx, &amp;target_name, GSS_C_NO_OID,
    GSS_C_MUTUAL_FLAG, GSS_C_INDEFINITE, GSS_C_NO_CHANNEL_BINDINGS, &amp;in, NULL, &amp;out, &amp;ret_flags, NULL);</pre>
<p>You need to check that ret_flags is what you wanted in flags, the reason is that the server might downgarde your security to a level you don&#8217;t find acceptiable, like no encryption (leaving out GSS_C_CONF_FLAG).</p>
<h2>The logic flow for ISC</h2>
<p>The flow of a client part of gss-api negotiation looks like this:</p>
<pre>name = gss_import_name("service@server", GSS_C_NT_HOSTBASED_SERVICE);

if (client_name &amp;&amp; client_name_type) {
   cname = gss_import_name(client_name, client_name_type);
   cred = gss_acquire_cred(cname, GSS_C_INITIATE);
} else
   cred = NULL;

in = null;
do {
   ret = gss_init_sec_context(in, out);
   if (GSS_ERROR(ret))
      abort();
  send_message(out);
  if (ret == GSS_C_CONTINUE)
      in = read_message();
} while (ret == GSS_C_CONTINUE);

if (check_return_flags())
   abort();

/* done */</pre>
<h2>Next out is gss_accept_sec_context (ASC)</h2>
<p>ASC is the awesome function, mostly every time we have to fix 3rd party code that uses ASC the resolution is mostly always to <strong>remove</strong> code</p>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2009/09/the-use-of-of-gss_init_sec_context-isc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Support for ECDSA and ECDH in PK-INIT</title>
		<link>http://www.h5l.org/blog/index.php/2009/02/support-for-ecdsa-and-ecdh-in-pk-init/</link>
		<comments>http://www.h5l.org/blog/index.php/2009/02/support-for-ecdsa-and-ecdh-in-pk-init/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 20:31:49 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[Heimdal]]></category>
		<category><![CDATA[hx509]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=209</guid>
		<description><![CDATA[Heimdal now support support for ECDSA (Elliptic curve, signature mode) and ECDH (Elliptic curve, key exchange mode) when compiled with OpenSSL, no hcrypto support yet. Using ECDSA is turned on when using EC certificates, both the signature verification and CMS is done using EC certificate.
ECDH is turned used when using ECDSA, so also its also used when using EC certificates [...]]]></description>
			<content:encoded><![CDATA[<p>Heimdal now support support for ECDSA (Elliptic curve, signature mode) and ECDH (Elliptic curve, key exchange mode) when compiled with OpenSSL, no hcrypto support yet. Using ECDSA is turned on when using EC certificates, both the signature verification and CMS is done using EC certificate.</p>
<p>ECDH is turned used when using ECDSA, so also its also used when using EC certificates on the client. There is missing negotiation of EC curves, so the code is not future safe, but its something that we&#8217;ll add in the future.  Part of the regression test now uses the EC certificate. hxtool needs support for generating EC keys and exporting the SubjectPublicKeyInfo before its can sign certificates, neither of them too hard.</p>
<p>Too much of the OpenSSL EC implementation is hidden, so right now its not possible to load plugins. So no support for PKCS11 or Keychain based private keys.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2009/02/support-for-ecdsa-and-ecdh-in-pk-init/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New PKINIT bits, anonymous and enterprise support</title>
		<link>http://www.h5l.org/blog/index.php/2009/02/new-pkinit-bits-anonymous-and-enterprise-support/</link>
		<comments>http://www.h5l.org/blog/index.php/2009/02/new-pkinit-bits-anonymous-and-enterprise-support/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 03:04:13 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[Heimdal]]></category>
		<category><![CDATA[kerberos protocol]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=206</guid>
		<description><![CDATA[I&#8217;ve just added anonymous Kerberos/pkinit to the KDC and the client libraries. Still only AS-REQ, what is missing is TGS-REQ and GSS-API support.
kinit --anonymous REALM
What have been implemented is draft-ietf-krb-wg-anon-04.
At the same time support for enterprise names when using PK-INIT slipped it.  This is very cool, just point a cert, and the kinit will search [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just added <strong>anonymous Kerberos/pkinit</strong> to the KDC and the client libraries. Still only AS-REQ, what is missing is TGS-REQ and GSS-API support.</p>
<pre>kinit --anonymous REALM</pre>
<p>What have been implemented is <a href="tools.ietf.org/id/draft-ietf-krb-wg-anon-04">draft-ietf-krb-wg-anon-04</a>.</p>
<p>At the same time support for <strong>enterprise names when using PK-INIT </strong>slipped it.  This is very cool, just point a cert, and the kinit will search the cert for a windows nt-name, use that with a client referrals (enterprise name) and return you a ticket for your real principal name. The only problem is that right now windows 2008 DC doesn&#8217;t return client referrals PA-DATA, so that why we use &#8211;windows in the example below, it disable the client check.</p>
<pre>kinit --windows --pk-enterprise --canon -C FILE:w2k8.pem WINDOWS2008.DOMAIN</pre>
<p>The implementation show that the krb5_get_init_creds and friends need to be more aware PK-INIT and certificate selection. The reason the interface look the way it does is to avoid exposing that we are using hx509 beneath the kerberos library. So far I&#8217;ve not come up with a good langauge to express what certificate to select.</p>
<p>There is a query language in hx509, but its not something that you want to expose users too. Here are some examples:</p>
<pre>%{certificate.issuer} == "C=SE,CN=hx509 Test Root CA"
%{certificate.subject} TAILMATCH "C=SE"
%{certificate.hash.sha1} EQ "412120212A2CBFD777DE5499ECB4724345F33F16"</pre>
<p>Heimdal will show up for the Interop event in Redmond at the end of March, part of that we will do PK-INIT testing.</p>
<p>One things that really should be working by the is support for EC certificate and ECDSA, right now that support it not there in hx509 or hcrypto.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2009/02/new-pkinit-bits-anonymous-and-enterprise-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up PK-INIT with Heimdal</title>
		<link>http://www.h5l.org/blog/index.php/2009/01/setting-up-pk-init-with-heimdal/</link>
		<comments>http://www.h5l.org/blog/index.php/2009/01/setting-up-pk-init-with-heimdal/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 05:51:47 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[Heimdal]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=197</guid>
		<description><![CDATA[Setting up Heimdal with PK-INIT is very easy. Heimdal by itself contains all the tools so you can do the setup. We assume that you don&#8217;t have CA when we do the setup.
Some facts
The realm name we are going to use is EXAMPLE.ORG, the kdc is named kdc.example.org, the user is user@EXMAPLE.ORG.
Create the certificates needed
First [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up Heimdal with PK-INIT is very easy. Heimdal by itself contains all the tools so you can do the setup. We assume that you don&#8217;t have CA when we do the setup.</p>
<h3>Some facts</h3>
<p>The realm name we are going to use is <strong>EXAMPLE.ORG<span style="font-weight: normal;">, the kdc is named </span><strong>kdc.example.org</strong><span style="font-weight: normal;">, the user is </span><strong>user@EXMAPLE.ORG</strong>.</strong></p>
<h3>Create the certificates needed</h3>
<p><span style="font-weight: normal;">First we create the CA certificate. The create file ca.pem contains both </span><span style="font-weight: normal;">private key and the certificate</span><span style="font-weight: normal;">, you should make sure the private key is removed when distributing the certificate to clients and the KDC.</span></p>
<pre>hxtool issue-certificate \
          --self-signed \
          --issue-ca \
          --generate-key=rsa \
          --subject="CN=CA,DC=example,DC=org" \
          --certificate="FILE:ca.pem"</pre>
<p><span style="font-weight: normal;">Then the user&#8217;s certificate, here we add the PK-INIT options for a<br />
PK-INIT client.</span></p>
<pre>hxtool issue-certificate \
          --ca-certificate=FILE:ca.pem \
          --generate-key=rsa \
          --type="pkinit-client" \
          --pk-init-principal="user@EXAMPLE.ORG" \
          --subject="cn=user,DC=example,DC=org" \
          --certificate="FILE:user.pem"</pre>
<p><span style="font-weight: normal;">Last we create the KDC&#8217;s certificate, here we add the PK-INIT options<br />
for a PK-INIT client.</span></p>
<pre>hxtool issue-certificate \
          --ca-certificate=FILE:ca.pem \
          --generate-key=rsa \
          --type="pkinit-kdc" \
          --pk-init-principal="krbtgt/EXAMPLE.ORG@EXAMPLE.ORG" \
          --subject="cn=kdc,DC=example,DC=org" \
          --certificate="FILE:kdc.pem"</pre>
<h3>Creating the database</h3>
<p><span style="font-weight: normal;">Just for completeness we are including the setup of your KDC here</span></p>
<pre>kadmin -l -r EXAMPLE.COM
kadmin&gt; init EXAMPLE.ORG</pre>
<p><span style="font-weight: normal;">Lets add our user to the database.</span></p>
<pre>kadmin&gt; add user
kadmin&gt; modify --pkinit-acl=cn=user,DC=example,DC=org --attribute=+requires-pre-auth user</pre>
<p><span style="font-weight: normal;">That all that needs to do to create the database and set up the user.</span></p>
<h3>Setting up the KDC configuration</h3>
<p><span style="font-weight: normal;">All KDC configuration is stored in /etc/krb5.conf (or /var/heimdal/kdc.conf), the content should contain this:</span></p>
<pre>[kdc]
	enable-pkinit = true
	pkinit_identity = FILE:kdc.pem
	pkinit_anchors = FILE:ca.pem</pre>
<h3>Start the KDC</h3>
<p><span style="font-weight: normal;">Start the KDC</span></p>
<pre>/usr/heimdal/libexec/kdc --detach</pre>
<h3>Get tickets using PK-INIT</h3>
<p><span style="font-weight: normal;">First we need to configure the trust anchors (what certificate authorities) to trust for the client.</span></p>
<pre>[appdefaults]
	pkinit_anchors = FILE:ca.pem</pre>
<p><span style="font-weight: normal;">Now we can get the ticket.</span></p>
<pre>kinit -C FILE:user.pem user@EXAMPLE.COM</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2009/01/setting-up-pk-init-with-heimdal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fetching tickets over EAP</title>
		<link>http://www.h5l.org/blog/index.php/2008/12/fetching-tickets-over-eap/</link>
		<comments>http://www.h5l.org/blog/index.php/2008/12/fetching-tickets-over-eap/#comments</comments>
		<pubDate>Thu, 25 Dec 2008 15:00:35 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[Heimdal]]></category>
		<category><![CDATA[gss-api]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=193</guid>
		<description><![CDATA[Or how to talk to the Kerberos KDC over your appliation protocol
Talking to the KDC with no network
Sometimes you want to talk to the KDC when there is limited or direct network. Or your application simply knows better how to communicate with the KDC.
For example, if it was possible to use EAP with GSS-API so it run Kerberos [...]]]></description>
			<content:encoded><![CDATA[<p>Or how to talk to the Kerberos KDC over your appliation protocol</p>
<h2>Talking to the KDC with no network</h2>
<p>Sometimes you want to talk to the KDC when there is limited or direct network. Or your application simply knows better how to communicate with the KDC.</p>
<p>For example, if it was possible to use EAP with GSS-API so it run Kerberos initial ticket fetching over the EAP channel, this is not so far off given the new IAKERB gss-api mechanism that Larry Zhu is proposing (currently in last call). With his mechanism you can talk to the KDC and get initial and service tickets for a service over a gss-api channel.</p>
<p>First the when you login to the network using EAP the network topology looks like this:</p>
<pre>Client ---[EAP over wavelan]---&gt; Wavelan access point ---[radius]---&gt; Radius server</pre>
<p>First you authenticate to the radius server, and the radius server tells the access point to let you out on the network, and then you get a IP address from the DHCP server. So why doesn&#8217;t this fit together with the Kerberos stack.</p>
<p>In the classial appliation the world looks like this:</p>
<pre>Application -&gt; GSS-API -&gt; Kerberos mechanism &lt;--[Kerberos protocol]--&gt; KDC
                 |
              [token]
                 |
  appl &lt;---------/
   |
   |
   \
    ------[application protocol]----&gt;  server</pre>
<p>But when you are in an about to use EAP to login to the network, theKerberos mechanism have no way to talk to the KDC, the only channel you have EAP the channel to the Radius server.</p>
<p>So the obvious solution is to let the Kerberos mechanism talk though the EAP channel over the the Radius server, and have the radius server forward over the packets over the the KDC.</p>
<h2>The problem with Kerberos krb5_get_init_creds()</h2>
<p>The Kerberos function krb5_get_init_creds() is that it expect to be able to resolve the DNS information to the KDC and then talk to the KDC to get initial tickets, so deep inside the function there is a function that will send of a packet the the KDC.</p>
<p>As described above, this wont work since the Kerberos library have no network connection to the KDC, it have to talk to the KDC thought the GSS-API layer.</p>
<h2>The replacement function, krb5_init_creds()</h2>
<p>So the new function krb5_init_creds() and krb5_init_creds_step() instead of sending of the packet to the KDC, return the packet that is supposed to be sent off to the KDC, and the expect the caller to call<br />
krb5_init_creds_step() with whatever the KDC returned. There is a helper function that does all this: krb5_init_creds_get().</p>
<p>So krb5_get_init_creds_password() is now implmented in terms of the new functions. And is as described below.</p>
<pre>krb5_get_init_creds_password()
{
   krb5_init_creds_init(&amp;ctx);
   krb5_init_creds_get(ctx);
   krb5_init_creds_free(ctx);
}

krb5_init_creds_get(ctx)
{
    while(1) {
       ret = krb5_init_creds_step(ctx,inpacket, &amp;outpacket);
       if (ret != CONTINUE)
         break;
       krb5_send_to_kdc(outnpacket, &amp;inpacket);
    }
}</pre>
<h2>GSS-API usage of krb5_init_creds_step()</h2>
<p>This way GSS-API mech can take advantage of the split stack and instead of sending the packet to the KDC, send of the packet over to GSS-API peer and when it get back the reply, stuff the answer back into krb5_init_creds_step() to continue the dance. </p>
<p><span style="font-family: 'Courier New'; line-height: 18px; white-space: pre;">Application -&gt; GSS-API &lt;&#8211;&gt; Kerberos mechanism</span></p>
<pre>                 |
              [token]
                 |
  appl &lt;---------/
   |
   |
   \
    ------[application protocol]----&gt;  server &lt;--[Kerberos protocol]--&gt; KDC</pre>
<p>Now, someone just need to implement IAKERB to use this functionallity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2008/12/fetching-tickets-over-eap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The krb5-cc-[gs]et-config API</title>
		<link>http://www.h5l.org/blog/index.php/2008/10/the-krb5-cc-gset-config-api/</link>
		<comments>http://www.h5l.org/blog/index.php/2008/10/the-krb5-cc-gset-config-api/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 04:15:53 +0000</pubDate>
		<dc:creator>lha</dc:creator>
				<category><![CDATA[Heimdal]]></category>

		<guid isPermaLink="false">http://www.h5l.org/blog/?p=186</guid>
		<description><![CDATA[I&#8217;ve created a new API to the krb5_ functions, its for storing Kerberos related data in the credential cache.

Realm configuration that is fetched runtime, for that the target is a domain that only should have Kerberos canonlization done and not dns canonlization
Forwarded tickets, to avoid re-fetching the from the KDC

krb5_cc_get_config
krb5_is_config_principal
krb5_cc_set_config
There is a patch for MIT Kerberos that also [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a new API to the krb5_ functions, its for storing Kerberos related data in the credential cache.</p>
<ul>
<li>Realm configuration that is fetched runtime, for that the target is a domain that only should have Kerberos canonlization done and not dns canonlization</li>
<li>Forwarded tickets, to avoid re-fetching the from the KDC</li>
</ul>
<p><a href="http://www.h5l.org/manual/HEAD/krb5/group__krb5__ccache.html#g89f51b75326b1119ed104c329c8aa66f">krb5_cc_get_config</a><br />
<a href="http://www.h5l.org/manual/HEAD/krb5/group__krb5__ccache.html#g9218c86e2fdea6c7e7b6a81ed8a8eb08">krb5_is_config_principal</a><br />
<a href="http://www.h5l.org/manual/HEAD/krb5/group__krb5__ccache.html#gf58b1c3a297bda69c7a69be4679a684e">krb5_cc_set_config</a></p>
<p>There is a patch for MIT Kerberos that also includes this interface, so hopefully it will be included in MIT Kerberos 1.7.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.h5l.org/blog/index.php/2008/10/the-krb5-cc-gset-config-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
