Skip to content

Commit 151b5dc

Browse files
author
Jonas Maier
committed
add TS_REQ_get_msg_imprint
1 parent ea3182d commit 151b5dc

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

openssl-sys/src/ts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ extern "C" {
7070
pub fn i2d_TS_REQ(a: *const TS_REQ, pp: *mut *mut c_uchar) -> c_int;
7171
pub fn TS_REQ_set_version(a: *mut TS_REQ, version: c_long) -> c_int;
7272
pub fn TS_REQ_set_msg_imprint(a: *mut TS_REQ, msg_imprint: *mut TS_MSG_IMPRINT) -> c_int;
73+
pub fn TS_REQ_get_msg_imprint(a: *mut TS_REQ) -> *mut TS_MSG_IMPRINT;
7374
pub fn TS_REQ_set_nonce(a: *mut TS_REQ, nonce: *const ASN1_INTEGER) -> c_int;
7475
pub fn TS_REQ_set_cert_req(a: *mut TS_REQ, cert_req: c_int) -> c_int;
7576

openssl/src/ts.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::bio::MemBioSlice;
1616
use crate::error::ErrorStack;
1717
use crate::hash::{Hasher, MessageDigest};
1818
use crate::pkey::{HasPrivate, PKeyRef};
19+
use crate::util::ForeignTypeExt;
1920
use crate::x509::{X509Algorithm, X509AlgorithmRef, X509Ref};
2021
use crate::{cvt, cvt_p};
2122

@@ -155,6 +156,15 @@ impl TsReq {
155156
unsafe { cvt(ffi::TS_REQ_set_msg_imprint(self.as_ptr(), imprint.as_ptr())).map(|_| ()) }
156157
}
157158

159+
/// Get the message imprint
160+
#[corresponds(TS_REQ_get_msg_imprint)]
161+
pub fn get_msg_imprint(&mut self) -> Option<TsMsgImprint> {
162+
unsafe {
163+
let imprint = ffi::TS_REQ_get_msg_imprint(self.as_ptr());
164+
TsMsgImprint::from_ptr_opt(imprint)
165+
}
166+
}
167+
158168
/// Sets the OID of the policy under which we're requesting the timestamp.
159169
///
160170
/// This corresponds to `TS_REQ_set_policy_id`.

0 commit comments

Comments
 (0)