From addd2519d240bee9f09690cbef3342c7bb0d009f Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Fri, 4 Jan 2019 12:06:49 -0500 Subject: [PATCH] minor comment cleanup --- src/crypto.c | 10 +++++----- src/crypto_impl.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index 6c027cad..392f9941 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -180,7 +180,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef }else if( sqlite3StrICmp(zLeft,"cipher_default_kdf_iter")==0 ){ if( zRight ) { - sqlcipher_set_default_kdf_iter(atoi(zRight)); // change default KDF iterations + sqlcipher_set_default_kdf_iter(atoi(zRight)); /* change default KDF iterations */ } else { char *kdf_iter = sqlite3_mprintf("%d", sqlcipher_get_default_kdf_iter()); codec_vdbe_return_string(pParse, "cipher_default_kdf_iter", kdf_iter, P4_DYNAMIC); @@ -189,7 +189,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef if( sqlite3StrICmp(zLeft, "kdf_iter")==0 ){ if(ctx) { if( zRight ) { - sqlcipher_codec_ctx_set_kdf_iter(ctx, atoi(zRight)); // change of RW PBKDF2 iteration + sqlcipher_codec_ctx_set_kdf_iter(ctx, atoi(zRight)); /* change of RW PBKDF2 iteration */ } else { char *kdf_iter = sqlite3_mprintf("%d", sqlcipher_codec_ctx_get_kdf_iter(ctx)); codec_vdbe_return_string(pParse, "kdf_iter", kdf_iter, P4_DYNAMIC); @@ -199,7 +199,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef if( sqlite3StrICmp(zLeft, "fast_kdf_iter")==0){ if(ctx) { if( zRight ) { - sqlcipher_codec_ctx_set_fast_kdf_iter(ctx, atoi(zRight)); // change of RW PBKDF2 iteration + sqlcipher_codec_ctx_set_fast_kdf_iter(ctx, atoi(zRight)); /* change of RW PBKDF2 iteration */ } else { char *fast_kdf_iter = sqlite3_mprintf("%d", sqlcipher_codec_ctx_get_fast_kdf_iter(ctx)); codec_vdbe_return_string(pParse, "fast_kdf_iter", fast_kdf_iter, P4_DYNAMIC); @@ -258,7 +258,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef if( sqlite3StrICmp(zLeft,"cipher_hmac_pgno")==0 ){ if(ctx) { if(zRight) { - // clear both pgno endian flags + /* clear both pgno endian flags */ if(sqlite3StrICmp(zRight, "le") == 0) { sqlcipher_codec_ctx_unset_flag(ctx, CIPHER_FLAG_BE_PGNO); sqlcipher_codec_ctx_set_flag(ctx, CIPHER_FLAG_LE_PGNO); @@ -616,7 +616,7 @@ static void* sqlite3Codec(void *iCtx, void *data, Pgno pgno, int mode) { static void sqlite3FreeCodecArg(void *pCodecArg) { codec_ctx *ctx = (codec_ctx *) pCodecArg; if(pCodecArg == NULL) return; - sqlcipher_codec_ctx_free(&ctx); // wipe and free allocated memory for the context + sqlcipher_codec_ctx_free(&ctx); /* wipe and free allocated memory for the context */ sqlcipher_deactivate(); /* cleanup related structures, OpenSSL etc, when codec is detatched */ } diff --git a/src/crypto_impl.c b/src/crypto_impl.c index 84817cdb..e5f22b83 100644 --- a/src/crypto_impl.c +++ b/src/crypto_impl.c @@ -504,10 +504,10 @@ static int sqlcipher_cipher_ctx_copy(codec_ctx *ctx, cipher_ctx *target, cipher_ sqlcipher_free(target->keyspec, ctx->keyspec_sz); memcpy(target, source, sizeof(cipher_ctx)); - target->key = key; //restore pointer to previously allocated key data + target->key = key; /* restore pointer to previously allocated key data */ memcpy(target->key, source->key, ctx->key_sz); - target->hmac_key = hmac_key; //restore pointer to previously allocated hmac key data + target->hmac_key = hmac_key; /* restore pointer to previously allocated hmac key data */ memcpy(target->hmac_key, source->hmac_key, ctx->key_sz); if(source->pass && source->pass_sz) { @@ -1090,7 +1090,7 @@ static int sqlcipher_cipher_ctx_key_derive(codec_ctx *ctx, cipher_ctx *c_ctx) { ctx->hmac_kdf_salt, c_ctx->fast_kdf_iter, ctx->key_sz); - if(c_ctx->pass && c_ctx->pass_sz) { // if pass is not null + if(c_ctx->pass && c_ctx->pass_sz) { /* if pass is not null */ if(ctx->need_kdf_salt) { sqlite3_file *fd = sqlite3PagerFile(ctx->pBt->pBt->pPager); /* read salt from header, if present, otherwise generate a new random salt */