-
-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add nonces to OCSP requests and responses #1045
Comments
Awesome! The standard equivalent Rust type for that would be a impl OcspRequestRef {
pub fn add_nonce(&mut self, val: Option<&[u8]>) -> Result<(), ErrorStack> {
unsafe {
let (ptr, len) = match val {
Some(slice) => (slice.as_ptr() as *mut _, slice.len() as c_int),
None => (ptr::null_mut(), 0),
};
cvt(ffi::OCSP_request_add1_nonce(self.as_ptr(), ptr, len))?;
Ok(())
}
}
} Your intuition about check_nonce and copy_nonce makes sense to me. |
scolby33
added a commit
to scolby33/rust-openssl
that referenced
this issue
Jan 24, 2019
mvertescher
pushed a commit
to mvertescher/rust-openssl
that referenced
this issue
Sep 27, 2019
- References sfackler#1045. - Add test for creation of OCSP request. - With and without a nonce. - Add custom return/error type for ocsp::check_nonce. - Fix signature of ocsp::BasicResponseRef::copy_nonce. - Add Error::description implementation as required by older versions of Rust.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to make the following functionality be exposed via the Rust API:
int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len)
int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len)
int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs)
int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req)
I am happy to make a pull request for this, however I am a bit unfamiliar (read: almost totally unfamiliar) with Rust FFI and am not sure exactly how to expose the
unsigned char *val, int len
tuple in Rust.Also, where should the check and copy functionality be implemented? My instinct is
OCSP_check_nonce
should be a free function and thatOCSP_copy_nonce
should be on the response object, but input on this is welcome.Here is an outline of my proposed implementation of this. The version for
OCSP_BASICRESP
is obviously similar.The text was updated successfully, but these errors were encountered: