Skip to content

Commit 57c7efc

Browse files
Christiaan676Christiaan676
andauthored
Remove wirte_pem function, as its incorrect and write_pem_string should be used. (#311)
Co-authored-by: Christiaan676 <[email protected]>
1 parent 77df7c2 commit 57c7efc

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

mbedtls/src/x509/csr.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -167,27 +167,6 @@ impl<'a> Builder<'a> {
167167
)
168168
}
169169

170-
pub fn write_pem<'buf, F: Random>(
171-
&mut self,
172-
buf: &'buf mut [u8],
173-
rng: &mut F,
174-
) -> Result<Option<&'buf [u8]>> {
175-
match unsafe {
176-
x509write_csr_der(
177-
&mut self.inner,
178-
buf.as_mut_ptr(),
179-
buf.len(),
180-
Some(F::call),
181-
rng.data_ptr(),
182-
)
183-
.into_result()
184-
} {
185-
Err(e) if e.low_level() == Some(codes::Base64BufferTooSmall) => Ok(None),
186-
Err(e) => Err(e),
187-
Ok(n) => Ok(Some(&buf[buf.len() - (n as usize)..])),
188-
}
189-
}
190-
191170
pub fn write_pem_string<F: Random>(&mut self, rng: &mut F) -> Result<String> {
192171
alloc_string_repeat(|buf, size| unsafe {
193172
match x509write_csr_pem(

0 commit comments

Comments
 (0)