@@ -200,6 +200,24 @@ impl OcspBasicResponseRef {
200
200
}
201
201
}
202
202
}
203
+
204
+ pub fn add_nonce ( & mut self , val : Option < & [ u8 ] > ) -> Result < ( ) , ErrorStack > {
205
+ unsafe {
206
+ let ( ptr, len) = match val {
207
+ Some ( slice) => ( slice. as_ptr ( ) as * mut _ , slice. len ( ) as c_int ) ,
208
+ None => ( ptr:: null_mut ( ) , 0 ) ,
209
+ } ;
210
+ cvt ( ffi:: OCSP_basic_add1_nonce ( self . as_ptr ( ) , ptr, len) ) ?;
211
+ Ok ( ( ) )
212
+ }
213
+ }
214
+
215
+ pub fn copy_nonce ( & mut self , req : OcspRequestRef ) -> Result < ( ) , ErrorStack > {
216
+ unsafe {
217
+ cvt ( ffi:: OCSP_copy_nonce ( self . as_ptr ( ) , req. as_ptr ( ) ) ) ?;
218
+ Ok ( ( ) )
219
+ }
220
+ }
203
221
}
204
222
205
223
foreign_type_and_impl_send_sync ! {
@@ -336,6 +354,17 @@ impl OcspRequestRef {
336
354
Ok ( OcspOneReqRef :: from_ptr_mut ( ptr) )
337
355
}
338
356
}
357
+
358
+ pub fn add_nonce ( & mut self , val : Option < & [ u8 ] > ) -> Result < ( ) , ErrorStack > {
359
+ unsafe {
360
+ let ( ptr, len) = match val {
361
+ Some ( slice) => ( slice. as_ptr ( ) as * mut _ , slice. len ( ) as c_int ) ,
362
+ None => ( ptr:: null_mut ( ) , 0 ) ,
363
+ } ;
364
+ cvt ( ffi:: OCSP_request_add1_nonce ( self . as_ptr ( ) , ptr, len) ) ?;
365
+ Ok ( ( ) )
366
+ }
367
+ }
339
368
}
340
369
341
370
foreign_type_and_impl_send_sync ! {
@@ -345,3 +374,10 @@ foreign_type_and_impl_send_sync! {
345
374
pub struct OcspOneReq ;
346
375
pub struct OcspOneReqRef ;
347
376
}
377
+
378
+ pub fn check_nonce ( req : & OcspRequestRef , bs : & OcspBasicResponseRef ) -> Result < ( ) , ErrorStack > {
379
+ unsafe {
380
+ cvt ( ffi:: OCSP_check_nonce ( req. as_ptr ( ) , bs. as_ptr ( ) ) ) ?;
381
+ Ok ( ( ) )
382
+ }
383
+ }
0 commit comments