On Fri, May 08, 2009 at 10:11:22AM -0700, Alex Chen wrote: > Thanks for the information, Viktor. I am not familiar with the algorithms > used in SSL, but if I understand correctly, SHA-1/SHA-2 is only a hash > function, right?
SHA-1 and the 3 members of the SHA-2 family are hash functions, they are building blocks for higher-level algorithms, HMAC, private key signature and public key verification of message digests, ... > In OpenSSL source code, I see references of SHA-256, SHA-512, etc. that > belong to SHA-2 suites. If OpenSSL only supports SHA-1 HMAC, > where and how does the code get used? The OpenSSL toolkit can use any of the digests it supports in any context where the standards support a variable digest algorithm with a digest of the indicated type. In the context of SSL cipher-suites, SHA-2 is not an option for message integrity with SSLv2, SSLv3, TLS 1.0 and TLS 1.1. OpenSSL does not yet implement TLS 1.2. In the context of X.509 certificates, SHA-2 support can be enabled, but this is not inter-operable with most fielded systems that have no such support or have not enabled it. > I look at one of our self-signed certificate (.pem) file with the following > entries: > > Certificate: > Data: > Version: 3 (0x2) > Serial Number: 2 (0x2) > Signature Algorithm: md5WithRSAEncryption > > It appears that this certificate was generated with MD5 hash instead of SHA > hash, correct? How do we set the hash function to SHA instead of MD5? The man pages for req(1) and x509(1) cover this. Also, "sha1" is the default with OpenSSL 0.9.8 and later (0.9.7 and earlier default to md5). The "-sha1", "-md5", options are what you are looking for. -- Viktor. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org