Skip to content

Commit

Permalink
Remove wirte_pem function, as its incorrect and write_pem_string shou…
Browse files Browse the repository at this point in the history
…ld be used.
  • Loading branch information
Christiaan676 authored and Christiaan676 committed Aug 26, 2023
1 parent 77df7c2 commit 51376d4
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions mbedtls/src/x509/csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,27 +167,6 @@ impl<'a> Builder<'a> {
)
}

pub fn write_pem<'buf, F: Random>(
&mut self,
buf: &'buf mut [u8],
rng: &mut F,
) -> Result<Option<&'buf [u8]>> {
match unsafe {
x509write_csr_der(
&mut self.inner,
buf.as_mut_ptr(),
buf.len(),
Some(F::call),
rng.data_ptr(),
)
.into_result()
} {
Err(e) if e.low_level() == Some(codes::Base64BufferTooSmall) => Ok(None),
Err(e) => Err(e),
Ok(n) => Ok(Some(&buf[buf.len() - (n as usize)..])),
}
}

pub fn write_pem_string<F: Random>(&mut self, rng: &mut F) -> Result<String> {
alloc_string_repeat(|buf, size| unsafe {
match x509write_csr_pem(
Expand Down

0 comments on commit 51376d4

Please sign in to comment.