<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yobi.be/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Karel</id>
	<title>YobiWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yobi.be/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Karel"/>
	<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Special:Contributions/Karel"/>
	<updated>2026-04-29T22:45:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=OpenID-eID&amp;diff=4975</id>
		<title>OpenID-eID</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=OpenID-eID&amp;diff=4975"/>
		<updated>2008-09-19T12:28:23Z</updated>

		<summary type="html">&lt;p&gt;Karel: the opensc package is needed for pkcs15-tool&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here are my attempts to create an [[OpenID]] provider based on the [[Belgian eID]]&lt;br /&gt;
&lt;br /&gt;
===Install packages===&lt;br /&gt;
Let&#039;s get apache2, php5 and openssl stuff:&lt;br /&gt;
 apt-get install apache2-utils apache2-mpm-prefork libapache2-mod-php5 php5 openssl ssl-cert opensc&lt;br /&gt;
&lt;br /&gt;
===Setup apache server with SSL===&lt;br /&gt;
Create self-signed certificate&lt;br /&gt;
 make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem&lt;br /&gt;
Little problem: by default the certificate is valid only 30 days, you&#039;ve to edit make-ssl-cert script and add &amp;quot;-days&amp;quot; options, e.g:&lt;br /&gt;
 openssl req -days 1024 ...&lt;br /&gt;
Verify generated certificate &lt;br /&gt;
 openssl x509 -text -in /etc/apache2/ssl/apache.pem&lt;br /&gt;
Start from ssl example config&lt;br /&gt;
 zcat /usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-ssl.conf.gz \&lt;br /&gt;
   &amp;gt; /etc/apache2/sites-available/default-ssl&lt;br /&gt;
Activates ssl module&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
Activates ssl virtualhost&lt;br /&gt;
 a2ensite default-ssl&lt;br /&gt;
Edit /etc/apache2/sites-available/default-ssl&lt;br /&gt;
 SSLCertificateFile /etc/apache2/ssl/apache.pem&lt;br /&gt;
 #SSLCertificateKeyFile not required as apache.pem contains also the key&lt;br /&gt;
And the usual stuff&lt;br /&gt;
 DocumentRoot &amp;quot;/var/www&amp;quot;&lt;br /&gt;
 ServerName ...&lt;br /&gt;
 ServerAdmin ...&lt;br /&gt;
 ErrorLog /var/log/apache2/error.log&lt;br /&gt;
 TransferLog /var/log/apache2/access.log&lt;br /&gt;
To activate only the secure ciphers:&lt;br /&gt;
 SSLCipherSuite HIGH:MEDIUM:!ADH&lt;br /&gt;
 SSLProtocol -ALL +SSLv3 +TLSv1&lt;br /&gt;
&lt;br /&gt;
===Adding Belgian Government Root certificates===&lt;br /&gt;
You can extract the Belgium Root CA and the Citizen CA from your eID:&lt;br /&gt;
 pkcs15-tool --read-certificate 04 &amp;gt; /etc/apache2/ssl/ca/belgium.crt&lt;br /&gt;
 pkcs15-tool --read-certificate 06 &amp;gt;&amp;gt; /etc/apache2/ssl/ca/belgium.crt&lt;br /&gt;
Then add client certificate requirements to /etc/apache2/sites-available/default-ssl&lt;br /&gt;
 SSLCACertificateFile /etc/apache2/ssl/ca/belgium.crt&lt;br /&gt;
 SSLOptions +StrictRequire&lt;br /&gt;
 SSLVerifyClient require&lt;br /&gt;
 SSLVerifyDepth  10&lt;br /&gt;
 &amp;lt;Location /&amp;gt;&lt;br /&gt;
  # accept only certificates emitted by Citizen CA:&lt;br /&gt;
  SSLRequire %{SSL_CLIENT_I_DN_C} eq &amp;quot;BE&amp;quot; \&lt;br /&gt;
    and %{SSL_CLIENT_I_DN_CN} in {&amp;quot;Citizen CA&amp;quot;}&lt;br /&gt;
 &amp;lt;/Location&amp;gt;&lt;br /&gt;
According to the doc, because of a bug in Internet Explorer, you also need to add GlobalSign Root certificate...&lt;br /&gt;
===Retrieving citizens&#039; certificate information===&lt;br /&gt;
The user&#039;s distinguish name can be retrieved from php with&lt;br /&gt;
 $_SERVER[&#039;SSL_CLIENT_S_DN&#039;]&lt;br /&gt;
And the user&#039;s name with&lt;br /&gt;
 $_SERVER[&#039;SSL_CLIENT_S_DN_CN&#039;]&lt;br /&gt;
&lt;br /&gt;
===TODO: cf [http://www.belgium.be/zip/eid_authentication_proxy_fr.html apache SSL reverse proxy] proposed by the government===&lt;br /&gt;
* [http://issues.apache.org/bugzilla/show_bug.cgi?id=41123 OCSP support for mod_ssl]&lt;br /&gt;
Add to /etc/apache2/sites-available/default-ssl:&lt;br /&gt;
 SSLUseOCSP         on&lt;br /&gt;
 SSLForceValidation on&lt;br /&gt;
* [http://issues.apache.org/bugzilla/show_bug.cgi?id=35083 Certificate validation problems trapping]&lt;br /&gt;
Enable ssl_error_module:&lt;br /&gt;
 LoadModule ssl_error_module modules/mod_ssl_error.so&lt;br /&gt;
And add to /etc/apache2/sites-available/default-ssl:&lt;br /&gt;
 &amp;lt;IfModule mod_ssl_error.c&amp;gt;&lt;br /&gt;
 SSL_Error_DefaultURL &amp;quot;/error/invalid.html&amp;quot;&lt;br /&gt;
 SSL_Error_URL  23   &amp;quot;/error/revoked.html&amp;quot;&lt;br /&gt;
 SSL_Error_URL  10   &amp;quot;/error/expired.html&amp;quot;&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
cf doc...&lt;br /&gt;
* Or simply make the client certificate as optional and test for it in php&lt;br /&gt;
&lt;br /&gt;
===Hacking [http://siege.org/projects/phpMyID/ phpMyID]===&lt;br /&gt;
&lt;br /&gt;
Details on the patch&lt;br /&gt;
* remove HTTP Digest for the authorization step&lt;br /&gt;
* redirect authorization to HTTPS as we&#039;ll deal with SSL client certificates&lt;br /&gt;
* TODO&lt;br /&gt;
* [http://id.yobi.be/MyID.phps current source code of the hacked phpMyID]&lt;br /&gt;
&lt;br /&gt;
Status:&lt;br /&gt;
* I could validate the client certificate against the root CA and I could extract the data of the certificate&lt;br /&gt;
* I could create various OpenIDs based on the certificate data&amp;lt;br&amp;gt;Everything is extracted only from the names and RRN, not on the serial nr of the certificate or any part prone to be changed if you&#039;ve to renew your ID card! (unless they change the way they write your name on the certificate...)&lt;br /&gt;
* I still consider RRN as sensitive data so the IDs I can provide must be a balance between several factors:&lt;br /&gt;
** friendliness (easy to remember)&lt;br /&gt;
** displaying your name or not?&lt;br /&gt;
** avoid clashes&lt;br /&gt;
** RRN retrieval more or less robust against brute force retrieval&lt;br /&gt;
* So &#039;&#039;&#039;about security &amp;amp; clashes&#039;&#039;&#039;, the hash is very very safe, the others, well, it depends how likely is your name...&lt;br /&gt;
* I added a discover mode which tells you what are your OpenIDs given your own eID, you can try here:&lt;br /&gt;
 http://id.yobi.be/?openid.mode=discover&lt;br /&gt;
 # This will return in my case:&lt;br /&gt;
 http://id.yobi.be/?id=ae96fba0cd9515cd&lt;br /&gt;
 http://id.yobi.be/?id=philippe.teuwen.159&lt;br /&gt;
 http://id.yobi.be/?id=philippe.yvon.teuwen&lt;br /&gt;
Another kind of ID could be&lt;br /&gt;
 id=firstname.lastname.Hash(RRN|firstname2|initial3|firstname|lastname)&lt;br /&gt;
So it tells your name but still hides RRN is a moderately hard to brute-force hash as you&#039;ve to guess RRN but also your second firstname &amp;amp; initial of the third firstname (if you&#039;ve a single firstname you&#039;re out of luck, I&#039;ve 5 firstnames!)&lt;br /&gt;
&lt;br /&gt;
Estonian [https://openid.ee/about/english counterpart] plans to provide simply firstname.lastname and to build an index in case of clashes.&amp;lt;br&amp;gt;&lt;br /&gt;
But this requires to have a stateful server and I don&#039;t want that, I want anybody to build his own service and the generated OpenIDs will always be the same, only depending on the certificate data, not on &amp;quot;who came first&amp;quot;.&amp;lt;br&amp;gt;Otherwise imagine the mess if the server data gets destroyed!&lt;br /&gt;
* My OpenIDs are now valid and successfully tested with e.g. [http://www.openidenabled.com/resources/openid-test/checkup/start?openid_url=http%3A%2F%2Fid.yobi.be%2F%3Fid%3Dae96fba0cd9515cd this OpenID checking server]&lt;br /&gt;
&lt;br /&gt;
Todo:&lt;br /&gt;
* CRL &amp;amp; cf TODO patches above&lt;br /&gt;
* Maybe some stateful stuff on the server for minor info: pavatar, microid...&lt;br /&gt;
* Check if server is able to do stateful associations&lt;br /&gt;
* Support also for CAcert client certificates, be our own CA?&lt;br /&gt;
* Clean-up server and delegate URLs&lt;br /&gt;
** e.g. http://id.yobi.be &amp;amp; http://id.yobi.be/ae96fba0cd9515cd (or xri?)&lt;br /&gt;
* Move to php-openid&lt;br /&gt;
Security: &lt;br /&gt;
* If someone knows your name and your partial hash he can bruteforce your RRN (and your middle name if the attacker didn&#039;t get it) but is RRN a secret anymore? Given any email you signed with your eID is enough to simply extract (and not bruteforce) your RRN...&lt;/div&gt;</summary>
		<author><name>Karel</name></author>
	</entry>
</feed>