@@ -330,7 +330,7 @@ fn sign_server_csr(
330
330
) ?;
331
331
332
332
// Sign the certificate with the CA's private key
333
- builder. sign ( & ca_pkey, openssl:: hash:: MessageDigest :: sha256 ( ) ) ?;
333
+ builder. sign ( ca_pkey, openssl:: hash:: MessageDigest :: sha256 ( ) ) ?;
334
334
335
335
Ok ( builder. build ( ) )
336
336
}
@@ -360,7 +360,7 @@ fn write_outputs_zip(
360
360
} else {
361
361
zip. start_file ( & output. filename , options) ?;
362
362
}
363
- zip. write ( & output. data ) ?;
363
+ zip. write_all ( & output. data ) ?;
364
364
}
365
365
366
366
zip. finish ( ) ?;
@@ -372,12 +372,10 @@ fn write_outputs(outputs: &Vec<FileOutput>) -> Result<(), std::io::Error> {
372
372
for output in outputs {
373
373
#[ cfg( unix) ]
374
374
{
375
- let fmode;
376
- if output. is_key {
377
- fmode = MODE_KEY ;
378
- } else {
379
- fmode = MODE_NORMAL ;
380
- }
375
+ let fmode = match output. is_key {
376
+ true => MODE_KEY ,
377
+ false => MODE_NORMAL ,
378
+ } ;
381
379
382
380
let mut file = OpenOptions :: new ( )
383
381
. write ( true )
@@ -443,7 +441,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
443
441
// Output root CA privkey PEM
444
442
push_output (
445
443
& mut outputs,
446
- & basepath,
444
+ basepath,
447
445
& args. ca_key_out ,
448
446
& ca_key. private_key_to_pem_pkcs8 ( ) ?,
449
447
true ,
@@ -452,7 +450,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
452
450
// Output root CA cert PEM
453
451
push_output (
454
452
& mut outputs,
455
- & basepath,
453
+ basepath,
456
454
& args. ca_cert_out ,
457
455
& ca_cert. to_pem ( ) ?,
458
456
false ,
@@ -461,7 +459,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
461
459
// Output server privkey PEM
462
460
push_output (
463
461
& mut outputs,
464
- & basepath,
462
+ basepath,
465
463
& args. key_out ,
466
464
& server_key. private_key_to_pem_pkcs8 ( ) ?,
467
465
true ,
@@ -471,7 +469,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
471
469
if args. csr_out . is_some ( ) {
472
470
push_output (
473
471
& mut outputs,
474
- & basepath,
472
+ basepath,
475
473
& args. csr_out . unwrap ( ) ,
476
474
& server_csr. to_pem ( ) ?,
477
475
false ,
@@ -481,7 +479,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
481
479
// Output server cert PEM
482
480
push_output (
483
481
& mut outputs,
484
- & basepath,
482
+ basepath,
485
483
& args. cert_out ,
486
484
& server_cert. to_pem ( ) ?,
487
485
false ,
0 commit comments