From a828432a721ac1f3cec59e4b9daf19d5227563c3 Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Wed, 12 Jun 2013 11:01:38 -0400 Subject: [PATCH] normalize license statements, ifdefs, and wrapper comments --- src/crypto.c | 10 ++++------ src/crypto.h | 4 ++-- src/crypto_cc.c | 34 ++++++++++++++++++++++++++++++++++ src/crypto_impl.c | 9 ++++----- src/crypto_libtomcrypt.c | 34 ++++++++++++++++++++++++++++++++++ src/crypto_openssl.c | 34 ++++++++++++++++++++++++++++++++++ src/func.c | 8 ++++++++ src/pager.c | 4 ++-- src/pragma.c | 8 ++++---- src/sqlcipher.h | 4 ++-- 10 files changed, 128 insertions(+), 21 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index 9cae0211..2551e6ba 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -1,10 +1,8 @@ /* ** SQLCipher -** crypto.c developed by Stephen Lombardo (Zetetic LLC) -** sjlombardo at zetetic dot net -** http://zetetic.net +** http://sqlcipher.net ** -** Copyright (c) 2009, ZETETIC LLC +** Copyright (c) 2008 - 2013, ZETETIC LLC ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -30,7 +28,7 @@ ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** */ -/* BEGIN CRYPTO */ +/* BEGIN SQLCIPHER */ #ifdef SQLITE_HAS_CODEC #include @@ -626,5 +624,5 @@ end_of_export: #endif -/* END CRYPTO */ +/* END SQLCIPHER */ #endif diff --git a/src/crypto.h b/src/crypto.h index 70c09b0b..393fb0fd 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -30,7 +30,7 @@ ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** */ -/* BEGIN CRYPTO */ +/* BEGIN SQLCIPHER */ #ifdef SQLITE_HAS_CODEC #ifndef CRYPTO_H #define CRYPTO_H @@ -198,4 +198,4 @@ int sqlcipher_codec_ctx_get_flag(codec_ctx *ctx, unsigned int flag, int for_ctx) const char* sqlcipher_codec_get_cipher_provider(codec_ctx *ctx); #endif #endif -/* END CRYPTO */ +/* END SQLCIPHER */ diff --git a/src/crypto_cc.c b/src/crypto_cc.c index 63b85cee..537df7e3 100644 --- a/src/crypto_cc.c +++ b/src/crypto_cc.c @@ -1,3 +1,35 @@ +/* +** SQLCipher +** http://sqlcipher.net +** +** Copyright (c) 2008 - 2013, ZETETIC LLC +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in the +** documentation and/or other materials provided with the distribution. +** * Neither the name of the ZETETIC LLC nor the +** names of its contributors may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY +** EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY +** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +*/ +/* BEGIN SQLCIPHER */ +#ifdef SQLITE_HAS_CODEC #ifdef SQLCIPHER_CRYPTO_CC #include "crypto.h" #include "sqlcipher.h" @@ -104,3 +136,5 @@ int sqlcipher_cc_setup(sqlcipher_provider *p) { } #endif +#endif +/* END SQLCIPHER */ diff --git a/src/crypto_impl.c b/src/crypto_impl.c index adfbf888..a58927c7 100644 --- a/src/crypto_impl.c +++ b/src/crypto_impl.c @@ -1,10 +1,8 @@ /* ** SQLCipher -** crypto_impl.c developed by Stephen Lombardo (Zetetic LLC) -** sjlombardo at zetetic dot net -** http://zetetic.net +** http://sqlcipher.net ** -** Copyright (c) 2011, ZETETIC LLC +** Copyright (c) 2008 - 2013, ZETETIC LLC ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -30,7 +28,7 @@ ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** */ -/* BEGIN CRYPTO */ +/* BEGIN SQLCIPHER */ #ifdef SQLITE_HAS_CODEC #include "sqliteInt.h" @@ -802,3 +800,4 @@ const char* sqlcipher_codec_get_cipher_provider(codec_ctx *ctx) { } #endif +/* END SQLCIPHER */ diff --git a/src/crypto_libtomcrypt.c b/src/crypto_libtomcrypt.c index d3f40395..1a3383e0 100644 --- a/src/crypto_libtomcrypt.c +++ b/src/crypto_libtomcrypt.c @@ -1,3 +1,35 @@ +/* +** SQLCipher +** http://sqlcipher.net +** +** Copyright (c) 2008 - 2013, ZETETIC LLC +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in the +** documentation and/or other materials provided with the distribution. +** * Neither the name of the ZETETIC LLC nor the +** names of its contributors may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY +** EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY +** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +*/ +/* BEGIN SQLCIPHER */ +#ifdef SQLITE_HAS_CODEC #ifdef SQLCIPHER_CRYPTO_LIBTOMCRYPT #include "sqliteInt.h" #include "sqlcipher.h" @@ -179,3 +211,5 @@ int sqlcipher_ltc_setup(sqlcipher_provider *p) { } #endif +#endif +/* END SQLCIPHER */ diff --git a/src/crypto_openssl.c b/src/crypto_openssl.c index 44d887b8..d019813b 100644 --- a/src/crypto_openssl.c +++ b/src/crypto_openssl.c @@ -1,3 +1,35 @@ +/* +** SQLCipher +** http://sqlcipher.net +** +** Copyright (c) 2008 - 2013, ZETETIC LLC +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in the +** documentation and/or other materials provided with the distribution. +** * Neither the name of the ZETETIC LLC nor the +** names of its contributors may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY +** EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY +** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +*/ +/* BEGIN SQLCIPHER */ +#ifdef SQLITE_HAS_CODEC #ifdef SQLCIPHER_CRYPTO_OPENSSL #include "sqliteInt.h" #include "crypto.h" @@ -178,3 +210,5 @@ int sqlcipher_openssl_setup(sqlcipher_provider *p) { } #endif +#endif +/* END SQLCIPHER */ diff --git a/src/func.c b/src/func.c index 9e9ded17..c02f096a 100644 --- a/src/func.c +++ b/src/func.c @@ -1544,16 +1544,24 @@ static void groupConcatFinalize(sqlite3_context *context){ */ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){ int rc = sqlite3_overload_function(db, "MATCH", 2); +/* BEGIN SQLCIPHER */ +#ifdef SQLITE_HAS_CODEC #ifndef OMIT_EXPORT extern void sqlcipher_exportFunc(sqlite3_context *, int, sqlite3_value **); #endif +#endif +/* END SQLCIPHER */ assert( rc==SQLITE_NOMEM || rc==SQLITE_OK ); if( rc==SQLITE_NOMEM ){ db->mallocFailed = 1; } +/* BEGIN SQLCIPHER */ +#ifdef SQLITE_HAS_CODEC #ifndef OMIT_EXPORT sqlite3CreateFunc(db, "sqlcipher_export", 1, SQLITE_TEXT, 0, sqlcipher_exportFunc, 0, 0, 0); #endif +#endif +/* END SQLCIPHER */ } /* diff --git a/src/pager.c b/src/pager.c index cb3cb8da..61727faa 100644 --- a/src/pager.c +++ b/src/pager.c @@ -7161,7 +7161,7 @@ void *sqlite3PagerCodec(PgHdr *pPg){ #endif /* SQLITE_OMIT_DISKIO */ -/* BEGIN CRYPTO */ +/* BEGIN SQLCIPHER */ #ifdef SQLITE_HAS_CODEC void sqlite3pager_get_codec(Pager *pPager, void **ctx) { *ctx = pPager->pCodec; @@ -7190,5 +7190,5 @@ void sqlite3pager_sqlite3PagerSetError( Pager *pPager, int error) { } #endif -/* END CRYPTO */ +/* END SQLCIPHER */ diff --git a/src/pragma.c b/src/pragma.c index d4a42a71..22977169 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -320,11 +320,11 @@ void sqlite3Pragma( sqlite3 *db = pParse->db; /* The database connection */ Db *pDb; /* The specific database being pragmaed */ Vdbe *v = sqlite3GetVdbe(pParse); /* Prepared statement */ -/** BEGIN CRYPTO **/ +/* BEGIN SQLCIPHER */ #ifdef SQLITE_HAS_CODEC extern int codec_pragma(sqlite3*, int, Parse *, const char *, const char *); #endif -/** END CRYPTO **/ +/* END SQLCIPHER */ if( v==0 ) return; @@ -386,13 +386,13 @@ void sqlite3Pragma( pParse->rc = rc; }else -/** BEGIN CRYPTO **/ +/* BEGIN SQLCIPHER */ #ifdef SQLITE_HAS_CODEC if(codec_pragma(db, iDb, pParse, zLeft, zRight)) { /* codec_pragma executes internal */ }else #endif -/** END CRYPTO **/ +/* END SQLCIPHER */ #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED) /* diff --git a/src/sqlcipher.h b/src/sqlcipher.h index 98b01c2b..82753095 100644 --- a/src/sqlcipher.h +++ b/src/sqlcipher.h @@ -30,7 +30,7 @@ ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** */ -/* BEGIN CRYPTO */ +/* BEGIN SQLCIPHER */ #ifdef SQLITE_HAS_CODEC #ifndef SQLCIPHER_H #define SQLCIPHER_H @@ -69,5 +69,5 @@ int sqlcipher_register_provider(sqlcipher_provider *p); #endif #endif -/* END CRYPTO */ +/* END SQLCIPHER */ -- 2.11.4.GIT