Cryptography Reference
In-Depth Information
commercially signed certifi cate is going to be signed using RSA because that's
all that commercial CAs currently support.
You're unlikely to be able to fi nd a server that presents an ECDSA certifi cate.
However, as of version 1.0.0, OpenSSL enables you to create a self-signed ECDSA,
certifi cate. First, generate a set of parameters; in other words, select a named curve:
[jdavies@localhost ssl]$ openssl ecparam -name prime192v1 -out ecprime192v1.pem
As you can see from the ASN.1 output, there's nothing in there except the
OID of the named curve:
[jdavies@localhost ssl]$ ./asn1 -pem ecprime192v1.pem
0000: OBJECT IDENTIFIER (6:8) 2a 86 48 ce 3d 03 01 01
However, you can use this as input to the req command to generate a new
ECDSA certifi cate:
[jdavies@localhost ssl]$ openssl req -x509 -newkey ec:ecprime192v1.pem \
-keyout ecdsa_key.pem -out ecdsa_cert.pem -sha256
ECDHE Support in TLS
To actually make use of this new certifi cate, you should extend the TLS imple-
mentation to support the ECDHE_ECDSA cipher suites. Not every cipher algo-
rithm is supported with ECDHE_ECDSA key exchange (nor ECDH_RSA). In
fact, the only algorithms standardized by RFC 4492 are RC4, 3DES, AES-128,
and AES-256. These suites are given the identifi ers 0xC007 - 0xC00A . Because
these are large numbers, you should instantiate them in the init_tls function
just like the AEAD ciphers from Listing 9-27. The initialization of TLS_ECDHE_
ECDSA_WITH_AES_128_CBC_SHA is shown in Listing 9-38.
Listing 9-38: “tls.c” init_tls with ECDHE_ECDSA support
void init_tls()
{
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].id =
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].block_size = 16;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].IV_size = 16;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].key_size = 16;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].hash_size = SHA1_BYTE_SIZE;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].bulk_encrypt = aes_128_encrypt;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].bulk_decrypt = aes_128_decrypt;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].new_digest = new_sha1_digest;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].aead_encrypt = NULL;
suites[ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA ].aead_decrypt = NULL;
}
 
Search WWH ::




Custom Search