From 415c0aa250bb30e28ba0c8a4a5b012fff4e5bf12 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 21 Jun 2014 13:42:14 +0000 Subject: More KNF. --- src/lib/libcrypto/cmac/cm_ameth.c | 7 +++---- src/lib/libcrypto/cmac/cm_pmeth.c | 11 +++++------ src/lib/libcrypto/cmac/cmac.c | 10 +++++----- src/lib/libcrypto/cmac/cmac.h | 8 ++++---- 4 files changed, 17 insertions(+), 19 deletions(-) (limited to 'src/lib/libcrypto/cmac') diff --git a/src/lib/libcrypto/cmac/cm_ameth.c b/src/lib/libcrypto/cmac/cm_ameth.c index a793e65262..763d161cfe 100644 --- a/src/lib/libcrypto/cmac/cm_ameth.c +++ b/src/lib/libcrypto/cmac/cm_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cm_ameth.c,v 1.4 2014/06/21 12:07:02 miod Exp $ */ +/* $OpenBSD: cm_ameth.c,v 1.5 2014/06/21 13:42:14 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2010. */ @@ -10,7 +10,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -77,8 +77,7 @@ cmac_key_free(EVP_PKEY *pkey) CMAC_CTX_free(cmctx); } -const EVP_PKEY_ASN1_METHOD -cmac_asn1_meth = { +const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = { .pkey_id = EVP_PKEY_CMAC, .pkey_base_id = EVP_PKEY_CMAC, diff --git a/src/lib/libcrypto/cmac/cm_pmeth.c b/src/lib/libcrypto/cmac/cm_pmeth.c index 3010f91aca..5bb391d053 100644 --- a/src/lib/libcrypto/cmac/cm_pmeth.c +++ b/src/lib/libcrypto/cmac/cm_pmeth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cm_pmeth.c,v 1.5 2014/06/21 12:07:02 miod Exp $ */ +/* $OpenBSD: cm_pmeth.c,v 1.6 2014/06/21 13:42:14 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2010. */ @@ -10,7 +10,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -100,12 +100,12 @@ pkey_cmac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) return 0; } EVP_PKEY_assign(pkey, EVP_PKEY_CMAC, cmkey); - + return 1; } static int -int_update(EVP_MD_CTX *ctx,const void *data,size_t count) +int_update(EVP_MD_CTX *ctx, const void *data, size_t count) { if (!CMAC_Update(ctx->pctx->data, data, count)) return 0; @@ -193,8 +193,7 @@ pkey_cmac_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, const char *value) return -2; } -const EVP_PKEY_METHOD -cmac_pkey_meth = { +const EVP_PKEY_METHOD cmac_pkey_meth = { .pkey_id = EVP_PKEY_CMAC, .flags = EVP_PKEY_FLAG_SIGCTX_CUSTOM, diff --git a/src/lib/libcrypto/cmac/cmac.c b/src/lib/libcrypto/cmac/cmac.c index b2f77c59bd..b717f786f1 100644 --- a/src/lib/libcrypto/cmac/cmac.c +++ b/src/lib/libcrypto/cmac/cmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmac.c,v 1.6 2014/06/21 12:07:02 miod Exp $ */ +/* $OpenBSD: cmac.c,v 1.7 2014/06/21 13:42:14 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -10,7 +10,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -217,7 +217,7 @@ CMAC_Update(CMAC_CTX *ctx, const void *in, size_t dlen) return 1; data += nleft; /* Else not final block so encrypt it */ - if (!EVP_Cipher(&ctx->cctx, ctx->tbl, ctx->last_block,bl)) + if (!EVP_Cipher(&ctx->cctx, ctx->tbl, ctx->last_block, bl)) return 0; } /* Encrypt all but one of the complete blocks left */ @@ -257,7 +257,7 @@ CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen) out[i] = ctx->last_block[i] ^ ctx->k2[i]; } if (!EVP_Cipher(&ctx->cctx, out, out, bl)) { - OPENSSL_cleanse(out, bl); + OPENSSL_cleanse(out, bl); return 0; } return 1; @@ -272,7 +272,7 @@ CMAC_resume(CMAC_CTX *ctx) * which is the last IV (or all zeroes if no last encrypted block). * The last block has not been modified since CMAC_final(). * So reinitialising using the last decrypted block will allow - * CMAC to continue after calling CMAC_Final(). + * CMAC to continue after calling CMAC_Final(). */ return EVP_EncryptInit_ex(&ctx->cctx, NULL, NULL, NULL, ctx->tbl); } diff --git a/src/lib/libcrypto/cmac/cmac.h b/src/lib/libcrypto/cmac/cmac.h index 10ae543f41..cb6d64b02f 100644 --- a/src/lib/libcrypto/cmac/cmac.h +++ b/src/lib/libcrypto/cmac/cmac.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cmac.h,v 1.2 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: cmac.h,v 1.3 2014/06/21 13:42:14 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -10,7 +10,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -70,8 +70,8 @@ void CMAC_CTX_free(CMAC_CTX *ctx); EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); -int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, - const EVP_CIPHER *cipher, ENGINE *impl); +int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, + const EVP_CIPHER *cipher, ENGINE *impl); int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); int CMAC_resume(CMAC_CTX *ctx); -- cgit v1.2.3-55-g6feb