<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">When generating the random file, you can also do:<DIV>openssl rand -out /etc/raddb/certs/random 100</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Steve</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"><DIV><DIV><DIV>On Aug 9, 2005, at 3:16 PM, <A href="mailto:freeradius-users-request@lists.freeradius.org">freeradius-users-request@lists.freeradius.org</A> wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>From: </B></FONT><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Kris Benson <<A href="mailto:kbenson@sd57.bc.ca">kbenson@sd57.bc.ca</A>></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>Date: </B></FONT><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">August 9, 2005 11:18:10 AM PDT</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>To: </B></FONT><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">FreeRadius users mailing list <<A href="mailto:freeradius-users@lists.freeradius.org">freeradius-users@lists.freeradius.org</A>></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>Cc: </B><A href="mailto:freeradius-users@lists.freeradius.org"><FONT color="#000000" style="color: #000000">freeradius-users@lists.freeradius.org</FONT></A></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>Subject: </B><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><B>Re: FreeRadius EAP-TLS quesitons</B></FONT></FONT></P><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>Reply-To: </B><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">FreeRadius users mailing list <<A href="mailto:freeradius-users@lists.freeradius.org">freeradius-users@lists.freeradius.org</A>></FONT></FONT></P><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"> <P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">FreeRadius users mailing list <<A href="mailto:freeradius-users@lists.freeradius.org">freeradius-users@lists.freeradius.org</A>> on</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">August 9, 2005 at 10:54 -0800 wrote:</FONT></P> <BR><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">Hello,</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">Two part question:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">1. Is it critical to have certificates, dh and random files in<SPAN class="Apple-converted-space"> </SPAN></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">etc/raddb/certs directory for eap-tls to work.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">2. Is it ok to generate random file as date > random</FONT></P> <BR></BLOCKQUOTE><P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">1. Yes, sort of.<SPAN class="Apple-converted-space"> </SPAN>You can put it in a different directory if you change</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">the eap.conf entries.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">2. No. This is the correct way:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">To generate the dh file you can use a function that comes with openssl</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">openssl dhparam -check -text -5 512 -out dh</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">This will generate a 512 Diffie-Hellman key named dh.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">Move this file to /etc/mycerts/</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">mv dh /etc/mycerts/.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">To generate a random file you will need a short C program using openssl</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">libraries.<SPAN class="Apple-converted-space"> </SPAN>Paste this text into a file named 'random.c':</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">----8< cut---</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">#include <stdio.h></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">#include <openssl/rand.h></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">main (void) {</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">unsigned char buf[100];</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">if (!RAND_bytes(buf, 100)) {</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">// the usual md5(time+pid)</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">}</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">printf("Random : %s\n", buf);</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">}</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">----8< cut---</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">Compile it like this: gcc random.c -o random -lcrypto</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">I will generate 32-bit LSB executable named random, try it with ./random.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">Move this file to /etc/mycerts/:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">mv random /etc/mycerts/.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">-kb</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">--</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">Kris Benson, CCP, I.S.P.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">Technical Analyst, District Projects</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica Neue" size="3" style="font: 12.0px Helvetica Neue">School District #57 (Prince George)</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica Neue; min-height: 14.0px"><BR></P> <BR class="Apple-interchange-newline"></FONT></FONT></BLOCKQUOTE></DIV><BR></DIV></DIV></BODY></HTML>