diff options
author | Dirkjan Bussink <d.bussink@gmail.com> | 2020-12-14 11:58:24 +0100 |
---|---|---|
committer | Jakub Jelen <jjelen@redhat.com> | 2021-01-11 10:45:22 +0100 |
commit | 385ac0911dfc4db7955a0a8ee78b6b0cd189026d (patch) | |
tree | c74e6cb701f972c1498af9ab8fd4b3086b0f4119 /src | |
parent | 1991bdac0da9569c3f1dd416461d5a58fb24dd7d (diff) | |
download | libssh-385ac0911dfc4db7955a0a8ee78b6b0cd189026d.tar.gz libssh-385ac0911dfc4db7955a0a8ee78b6b0cd189026d.tar.xz libssh-385ac0911dfc4db7955a0a8ee78b6b0cd189026d.zip |
Fix formatting for file with changes
This fixes the formatting for src/libcrypto.c for the last bits where it
is not correct.
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcrypto.c | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/libcrypto.c b/src/libcrypto.c index cf375603..c82b4b5e 100644 --- a/src/libcrypto.c +++ b/src/libcrypto.c @@ -420,38 +420,39 @@ int ssh_kdf(struct ssh_crypto_struct *crypto, } #endif -HMACCTX hmac_init(const void *key, int len, enum ssh_hmac_e type) { - HMACCTX ctx = NULL; - - ctx = HMAC_CTX_new(); - if (ctx == NULL) { - return NULL; - } +HMACCTX hmac_init(const void *key, int len, enum ssh_hmac_e type) +{ + HMACCTX ctx = NULL; + ctx = HMAC_CTX_new(); + if (ctx == NULL) { + return NULL; + } - switch(type) { + switch (type) { case SSH_HMAC_SHA1: - HMAC_Init_ex(ctx, key, len, EVP_sha1(), NULL); - break; + HMAC_Init_ex(ctx, key, len, EVP_sha1(), NULL); + break; case SSH_HMAC_SHA256: - HMAC_Init_ex(ctx, key, len, EVP_sha256(), NULL); - break; + HMAC_Init_ex(ctx, key, len, EVP_sha256(), NULL); + break; case SSH_HMAC_SHA512: - HMAC_Init_ex(ctx, key, len, EVP_sha512(), NULL); - break; + HMAC_Init_ex(ctx, key, len, EVP_sha512(), NULL); + break; case SSH_HMAC_MD5: - HMAC_Init_ex(ctx, key, len, EVP_md5(), NULL); - break; + HMAC_Init_ex(ctx, key, len, EVP_md5(), NULL); + break; default: - HMAC_CTX_free(ctx); - ctx = NULL; - } + HMAC_CTX_free(ctx); + ctx = NULL; + } - return ctx; + return ctx; } -void hmac_update(HMACCTX ctx, const void *data, unsigned long len) { - HMAC_Update(ctx, data, len); +void hmac_update(HMACCTX ctx, const void *data, unsigned long len) +{ + HMAC_Update(ctx, data, len); } void hmac_final(HMACCTX ctx, unsigned char *hashmacbuf, unsigned int *len) @@ -460,7 +461,8 @@ void hmac_final(HMACCTX ctx, unsigned char *hashmacbuf, unsigned int *len) HMAC_CTX_free(ctx); } -static void evp_cipher_init(struct ssh_cipher_struct *cipher) { +static void evp_cipher_init(struct ssh_cipher_struct *cipher) +{ if (cipher->ctx == NULL) { cipher->ctx = EVP_CIPHER_CTX_new(); } |