From b573cc5d6d0ce765e0c1c5186c5d7f06517329c8 Mon Sep 17 00:00:00 2001 From: Roland Shoemaker Date: Wed, 2 Mar 2022 11:20:58 -0800 Subject: [PATCH] ocsp: add Response.Raw Fixes golang/go#38340 Change-Id: I77afc901584ac3361eafa13c9ee9f8cf9ec2ee28 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/389256 Trust: Roland Shoemaker Run-TryBot: Roland Shoemaker Auto-Submit: Roland Shoemaker TryBot-Result: Gopher Robot Reviewed-by: Damien Neil --- ocsp.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ocsp.go b/ocsp.go index 96972ae..4269ed1 100644 --- a/ocsp.go +++ b/ocsp.go @@ -345,6 +345,8 @@ func (req *Request) Marshal() ([]byte, error) { // Response represents an OCSP response containing a single SingleResponse. See // RFC 6960. type Response struct { + Raw []byte + // Status is one of {Good, Revoked, Unknown} Status int SerialNumber *big.Int @@ -518,6 +520,7 @@ func ParseResponseForCert(bytes []byte, cert, issuer *x509.Certificate) (*Respon } ret := &Response{ + Raw: bytes, TBSResponseData: basicResp.TBSResponseData.Raw, Signature: basicResp.Signature.RightAlign(), SignatureAlgorithm: getSignatureAlgorithmFromOID(basicResp.SignatureAlgorithm.Algorithm),