Cryptography Reference
In-Depth Information
load_huge( &received_signature.s,
decoded_signature.children->next->data,
decoded_signature.children->next->length );
asn1free( &decoded_signature );
if ( !dsa_verify( &parameters->server_public_key.dsa_parameters,
&parameters->server_public_key.dsa_public_key,
sha1_digest.hash,
SHA1_BYTE_SIZE,
&received_signature ) )
{
free_huge( &received_signature.r );
free_huge( &received_signature.s );
return 0;
}
free_huge( &received_signature.r );
free_huge( &received_signature.s );
}
return 1;
}
Notice that the SHA-1 digest is computed regardless of the signature type; it
is needed whether the signature is an RSA or DSA signature.
DHE is not very common; most servers still prefer RSA for key exchange,
and those that do support DHE still present an RSA, rather than a DSA,
certifi cate. This doesn't mean that RSA has an advantage over Diffi e-Hellman
for key exchange; RSA also uses the same private key over and over, for poten-
tially millions and millions of handshakes. There's no particular reason why
certifi cate-based Diffi e-Hellman can't be used, or why the server key exchange
can't include an RSA key which was different for each connection instead of DH
parameters. However, the fact that RSA can be used for both signature genera-
tion and encryption meant that it was more common in certifi cates, so this has
ended up being the way it was most often used.
Verifying Identity with Client Authentication
In almost all cases — unless the cipher suite is one of the DH_anon_XXX cipher
suites — the server is required to present a certifi cate, signed by a certifi cate
authority, whose subject name's CN fi eld matches the DNS name to which the
client is trying to connect. This is always useful to guard against man-in-the-
middle attacks; without this certifi cate, there's no way, at all, to be sure that a
malicious attacker didn't hijack your connection during the handshake.
But what about the reverse situation? The server has no way of verifying
that the client is really who it says it is. This may or may not be important, but
 
Search WWH ::




Custom Search