Fix whitespace.

This commit is contained in:
Guus Sliepen 2012-10-10 17:17:49 +02:00
parent 58f4b845b9
commit d917c8cb6b
73 changed files with 474 additions and 478 deletions

View file

@ -143,7 +143,7 @@ bool cipher_counter_xor(cipher_t *cipher, const void *indata, size_t inlen, void
unsigned char *out = outdata;
while(inlen--) {
// Encrypt the new counter value if we need it
// Encrypt the new counter value if we need it
if(!cipher->counter->n) {
int len;
if(!EVP_EncryptUpdate(&cipher->ctx, cipher->counter->block, &len, cipher->counter->counter, cipher->cipher->block_size)) {

View file

@ -26,12 +26,12 @@
#include "crypto.h"
void crypto_init(void) {
RAND_load_file("/dev/urandom", 1024);
RAND_load_file("/dev/urandom", 1024);
ENGINE_load_builtin_engines();
ENGINE_register_all_complete();
ENGINE_load_builtin_engines();
ENGINE_register_all_complete();
OpenSSL_add_all_algorithms();
OpenSSL_add_all_algorithms();
}
void crypto_exit(void) {

View file

@ -41,7 +41,7 @@ bool ecdh_generate_public(ecdh_t *ecdh, void *pubkey) {
logger(DEBUG_ALWAYS, LOG_ERR, "Generating EC key failed: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
const EC_POINT *point = EC_KEY_get0_public_key(*ecdh);
if(!point) {
EC_KEY_free(*ecdh);

View file

@ -34,7 +34,7 @@ bool ecdsa_set_base64_public_key(ecdsa_t *ecdsa, const char *p) {
logger(DEBUG_ALWAYS, LOG_DEBUG, "EC_KEY_new_by_curve_name failed: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
int len = strlen(p);
unsigned char pubkey[len / 4 * 3 + 3];
const unsigned char *ppubkey = pubkey;
@ -77,7 +77,7 @@ bool ecdsa_read_pem_private_key(ecdsa_t *ecdsa, FILE *fp) {
if(*ecdsa)
return true;
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read ECDSA private key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}

View file

@ -30,7 +30,7 @@
static bool prf_xor(int nid, const char *secret, size_t secretlen, char *seed, size_t seedlen, char *out, ssize_t outlen) {
digest_t digest;
if(!digest_open_by_nid(&digest, nid, -1))
return false;

View file

@ -54,7 +54,7 @@ bool rsa_read_pem_public_key(rsa_t *rsa, FILE *fp) {
if(*rsa)
return true;
*rsa = PEM_read_RSA_PUBKEY(fp, rsa, NULL, NULL);
if(*rsa)
@ -69,7 +69,7 @@ bool rsa_read_pem_private_key(rsa_t *rsa, FILE *fp) {
if(*rsa)
return true;
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read RSA private key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
@ -83,7 +83,7 @@ bool rsa_public_encrypt(rsa_t *rsa, void *in, size_t len, void *out) {
return true;
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to perform RSA encryption: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
return false;
}
bool rsa_private_decrypt(rsa_t *rsa, void *in, size_t len, void *out) {
@ -91,7 +91,7 @@ bool rsa_private_decrypt(rsa_t *rsa, void *in, size_t len, void *out) {
return true;
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to perform RSA decryption: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
return false;
}
bool rsa_active(rsa_t *rsa) {