mirror of https://github.com/ctz/rustls
client: simplify extraction of OCSP response
This commit is contained in:
parent
6e019c0848
commit
ef917607d0
|
@ -93,13 +93,12 @@ impl hs::State for ExpectCertificateStatus {
|
|||
self.handshake
|
||||
.transcript
|
||||
.add_message(&m);
|
||||
let mut status = require_handshake_msg_mut!(
|
||||
let server_cert_ocsp_response = require_handshake_msg_mut!(
|
||||
m,
|
||||
HandshakeType::CertificateStatus,
|
||||
HandshakePayload::CertificateStatus
|
||||
)?;
|
||||
)?.into_inner();
|
||||
|
||||
let server_cert_ocsp_response = status.take_ocsp_response();
|
||||
trace!(
|
||||
"Server stapled OCSP response is {:?}",
|
||||
&server_cert_ocsp_response
|
||||
|
|
|
@ -16,7 +16,6 @@ use crate::log::warn;
|
|||
use std::collections;
|
||||
use std::fmt;
|
||||
use std::io::Write;
|
||||
use std::mem;
|
||||
use webpki;
|
||||
|
||||
macro_rules! declare_u8_vec(
|
||||
|
@ -2092,9 +2091,8 @@ impl CertificateStatus {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn take_ocsp_response(&mut self) -> Vec<u8> {
|
||||
let new = PayloadU24::new(Vec::new());
|
||||
mem::replace(&mut self.ocsp_response, new).0
|
||||
pub fn into_inner(self) -> Vec<u8> {
|
||||
self.ocsp_response.0
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue