From 3f4ad28b7cd04e215e83119cec767b1f03b27547 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Fri, 21 Jun 2013 15:16:14 -0400 Subject: [PATCH] go.crypto/ocsp: make the zero value of RequestOptions valid and documented. R=bradfitz CC=golang-dev https://golang.org/cl/10431044 --- ocsp/ocsp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ocsp/ocsp.go b/ocsp/ocsp.go index 68e0235..a44d750 100644 --- a/ocsp/ocsp.go +++ b/ocsp/ocsp.go @@ -261,12 +261,12 @@ type request struct { // RequestOptions contains options for constructing OCSP requests. type RequestOptions struct { // Hash contains the hash function that should be used when - // constructing the OCSP request. + // constructing the OCSP request. If zero, SHA-1 will be used. Hash crypto.Hash } func (opts *RequestOptions) hash() crypto.Hash { - if opts == nil { + if opts == nil || opts.Hash == 0 { // SHA-1 is nearly universally used in OCSP. return crypto.SHA1 }