Skip to content

Commit

Permalink
Fix: whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Nov 5, 2023
1 parent d02ecab commit d30ca9c
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions src/lib/cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,37 +296,37 @@ static bool create_server_certificate(sds serverkey_file, EVP_PKEY **server_key,
* @param cert pointer to X509 struct to populate
*/
static bool load_certificate(sds key_file, EVP_PKEY **key, sds cert_file, X509 **cert) {
BIO *bio = NULL;
*cert = NULL;
*key = NULL;

/* Load private key. */
bio = BIO_new(BIO_s_file());
if (!BIO_read_filename(bio, key_file)) {
BIO_free_all(bio);
return false;
}
*key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
BIO_free_all(bio);
if (*key == NULL) {
return false;
}

/* Load certificate. */
bio = BIO_new(BIO_s_file());
if (!BIO_read_filename(bio, cert_file)) {
BIO_free_all(bio);
EVP_PKEY_free(*key);
return false;
}
*cert = PEM_read_bio_X509(bio, NULL, NULL, NULL);
BIO_free_all(bio);
if (!*cert) {
EVP_PKEY_free(*key);
return false;
}

return true;
BIO *bio = NULL;
*cert = NULL;
*key = NULL;

/* Load private key. */
bio = BIO_new(BIO_s_file());
if (!BIO_read_filename(bio, key_file)) {
BIO_free_all(bio);
return false;
}
*key = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
BIO_free_all(bio);
if (*key == NULL) {
return false;
}

/* Load certificate. */
bio = BIO_new(BIO_s_file());
if (!BIO_read_filename(bio, cert_file)) {
BIO_free_all(bio);
EVP_PKEY_free(*key);
return false;
}
*cert = PEM_read_bio_X509(bio, NULL, NULL, NULL);
BIO_free_all(bio);
if (!*cert) {
EVP_PKEY_free(*key);
return false;
}

return true;
}

/**
Expand Down

0 comments on commit d30ca9c

Please sign in to comment.