mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-05 12:50:30 +09:00
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>
This commit is contained in:
committed by
Jakub Jelen
parent
1991bdac0d
commit
385ac0911d
@@ -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;
|
||||
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;
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user