<?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>Felipe Alfaro Solana &#187; OpenSSL</title>
	<atom:link href="http://www.felipe-alfaro.org/blog/category/openssl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.felipe-alfaro.org/blog</link>
	<description>A little bit of technology, security and networking with Linux, FreeBSD and Mac OS X, plus some personal opinions.</description>
	<lastBuildDate>Sun, 23 Oct 2011 16:46:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>ssldump compile patch</title>
		<link>http://www.felipe-alfaro.org/blog/2005/11/20/ssldump-compile-patch/</link>
		<comments>http://www.felipe-alfaro.org/blog/2005/11/20/ssldump-compile-patch/#comments</comments>
		<pubDate>Sun, 20 Nov 2005 00:13:14 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://felipe-alfaro.org/blog/?p=77</guid>
		<description><![CDATA[I have had problems trying to compile ssldump-0.9b3 against OpenSSL 0.9.7. To fix it, I made the following patch: --- ssldump-0.9b3/base/pcap-snoop.c.old 2005-11-18 16:16:02.000000000 +0100 +++ ssldump-0.9b3/base/pcap-snoop.c 2005-11-18 16:16:20.000000000 +0100 @@ -49,7 +49,7 @@ #include #include -#include +#include #ifndef _WIN32 #include #endif]]></description>
			<content:encoded><![CDATA[<p>I have had problems trying to compile ssldump-0.9b3 against OpenSSL 0.9.7.</p>
<p>To fix it, I made the following <a href="/blog/wp-content/ssldump-0.9b3-pcap-bpf.patch" title="ssldump-0.9b3-pcap-bpf.patch">patch</a>:</p>
<pre>--- ssldump-0.9b3/base/pcap-snoop.c.old	2005-11-18 16:16:02.000000000 +0100
+++ ssldump-0.9b3/base/pcap-snoop.c	2005-11-18 16:16:20.000000000 +0100
@@ -49,7 +49,7 @@

 #include
<pcap .h>
 #include <unistd .h>
-#include <net /bpf.h>
+#include
<pcap -bpf.h>
 #ifndef _WIN32
 #include <sys /param.h>
 #endif</sys></pcap></net></unistd></pcap></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2005/11/20/ssldump-compile-patch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up Certificate Authority (CA) using OpenSSL</title>
		<link>http://www.felipe-alfaro.org/blog/2005/11/18/setting-up-certificate-authority-ca-using-openssl/</link>
		<comments>http://www.felipe-alfaro.org/blog/2005/11/18/setting-up-certificate-authority-ca-using-openssl/#comments</comments>
		<pubDate>Fri, 18 Nov 2005 16:08:25 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[X.509]]></category>

		<guid isPermaLink="false">http://felipe-alfaro.org/blog/?p=73</guid>
		<description><![CDATA[OpenSSL command-line tools offer a lot of functionality. OpenSSL can generate private keys and their corresponding public key certificate requests, can sign those certificate requests, publish certificate revocation lists (CRLs), convert between several encoding formats like DER, PEM, PKCS#12, etc. In this article I will describe how to use OpenSSL to set up a Certificate [...]]]></description>
			<content:encoded><![CDATA[<p><b>OpenSSL</b> command-line tools offer a lot of functionality. OpenSSL can generate private keys and their corresponding public key certificate requests, can sign those certificate requests, publish certificate revocation lists (CRLs), convert between several encoding formats like DER, PEM, PKCS#12, etc.</p>
<p>In this article I will describe how to use OpenSSL to set up a Certificate Authority (CA), how to generate private keys, generate certificate requests and sign them, using OpenSSL and the command-line on a Fedora Core 4 Linux system.</p>
<h4>Configuring OpenSSL</h4>
<p>Edit <em>/etc/pki/tls/openssl.cnf</em> and make sure the <em>[ CA_default ]</em> section looks like this:</p>
<pre>
[ CA_default ]

dir             = /etc/pki/CA           # Where everything is kept
certs           = $dir/certs            # Where the issued certs are kept
crl_dir         = $dir/crl              # Where the issued crl are kept
database        = $dir/index.txt        # database index file.
unique_subject  = no                    # Set to 'no' to allow creation of
                                        # several ctificates with same subject.
new_certs_dir   = $dir/newcerts         # default place for new certs.

certificate     = $dir/cacert.pem       # The CA certificate
serial          = $dir/serial           # The current serial number
#crlnumber      = $dir/crlnumber        # the current crl number must be
                                        # commented out to leave a V1 CRL
crl             = $dir/crl.pem          # The current CRL
private_key     = $dir/private/cakey.pem# The private key
RANDFILE        = $dir/private/.rand    # private random number file

x509_extensions = usr_cert              # The extentions to add to the cert

# Comment out the following two lines for the "traditional"
# (and highly broken) format.
name_opt        = ca_default            # Subject Name options
cert_opt        = ca_default            # Certificate field options

# Extension copying option: use with caution.
# copy_extensions = copy

# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
# so this is commented out by default to leave a V1 CRL.
# crlnumber must also be commented out to leave a V1 CRL.
# crl_extensions        = crl_ext

default_days    = 365                   # how long to certify for
default_crl_days= 30                    # how long before next CRL
default_md      = sha1                  # which md to use.
preserve        = no                    # keep passed DN ordering

# A few difference way of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that.
policy          = policy_match
</pre>
<h4>Creating the Certificate Authority (CA)</h4>
<p>This step will create the CA private key and a self-signed certificate (the CA certificate).</p>
<p>The CA certificate will be stored in <em>/etc/pki/CA/cacert.pem</em>, while the CA private key will be stored in <em>/etc/pki/CA/private/cakey.pem</em>:</p>
<pre>
openssl req -new -x509 -days 365 -newkey rsa:1024 \
  -keyout /etc/pki/CA/private/cakey.pem \
  -out /etc/pki/CA/cacert.pem
chmod 600 /etc/pki/CA/private/cakey.pem
</pre>
<p>A copy of every signed certificate will be stored into <em>/etc/pki/CA/newcerts</em>, with a name matching the certificate serial number plus the <em>.pem</em> extension:</p>
<pre>
mkdir /etc/pki/CA/newcerts
</pre>
<p>The <em>/etc/pki/CA/index.txt</em> file holds a log of every signed certificate:</p>
<pre>
touch /etc/pki/CA/index.txt
</pre>
<p>The <em>/etc/pki/CA/serial</em> file holds the next available X.509 serial number:</p>
<pre>
echo 01 > /etc/pki/CA/serial
</pre>
<h4>Generating a certificate request and its corresponding private key</h4>
<p>The following command will generate a random, 1024-bit private RSA key and its corresponding public key will be wrapped into a PEM-encoded certificate. This certificate is still unsigned and will be submitted later to the CA for signing:</p>
<pre>
openssl req -new -days 365 -newkey rsa:1024 \
  -keyout /etc/pki/CA/sslkey.pem
  -out /etc/pki/CA/sslcert.pem
</pre>
<p>The private key will get written to <em>/etc/pki/CA/sslkey.pem</em> while the public key, encoded inside an unsigned certificate, will get written to <em>/etc/pki/CA/sslcert.pem</em>.</p>
<p>The <em>-nodes</em> option can be used to avoid using a pass-phrase to protect the private key. This is optional, but some applications are unable to read the private key if it was protected by a pass-phrase, while others like FreeRADIUS can do so with no problems at all.</p>
<h4>Signing a certificate</h4>
<p>To sign a certificate stored in <em>/etc/pki/CA/sslcert.pem</em>, use the following command:</p>
<pre>
openssl ca -in /etc/pki/CA/sslcert.pem -out /etc/pki/CA/cert.pem
</pre>
<p>The resulting signed certificate will get outputted to <em>/etc/pki/CA/cert.pem</em>. Once the certificate has been signed, the unsigned certificate can be safely deleted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2005/11/18/setting-up-certificate-authority-ca-using-openssl/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

