Symbol visibility changed from default to hidden.
authorkyungwook tak <k.tak@samsung.com>
Tue, 3 Feb 2015 03:46:56 +0000 (12:46 +0900)
committerMaciej J. Karpiuk <m.karpiuk2@samsung.com>
Tue, 17 Feb 2015 11:12:14 +0000 (12:12 +0100)
Change-Id: I9b4b7e8af5ff62cd8c063a0ce45a899f166566d7
Signed-off-by: kyungwook tak <k.tak@samsung.com>
38 files changed:
src/CMakeLists.txt
src/include/ckm/ckm-certificate.h
src/include/ckm/ckm-control.h
src/include/ckm/ckm-key.h
src/include/ckm/ckm-manager-async.h
src/include/ckm/ckm-manager.h
src/include/ckm/ckm-pkcs12.h
src/include/ckm/ckm-type.h
src/include/ckmc/ckmc-type.h
src/manager/CMakeLists.txt
src/manager/client-capi/ckmc-error.cpp
src/manager/client-capi/ckmc-type.cpp
src/manager/client/client-common.h
src/manager/common/base64.h
src/manager/common/certificate-config.h
src/manager/common/certificate-impl.h
src/manager/common/certificate-store.h
src/manager/common/crypto.h
src/manager/common/descriptor-set.h
src/manager/common/digest.h
src/manager/common/file-lock.h
src/manager/common/key-impl.h
src/manager/common/message-buffer.h
src/manager/common/pkcs12-impl.h
src/manager/common/protocols.h
src/manager/common/smack-check.h
src/manager/common/symbol-visibility.h [new file with mode: 0644]
src/manager/dpl/core/include/dpl/assert.h
src/manager/dpl/core/include/dpl/binary_queue.h
src/manager/dpl/core/include/dpl/colors.h
src/manager/dpl/core/include/dpl/errno_string.h
src/manager/dpl/core/include/dpl/exception.h
src/manager/dpl/core/include/dpl/fstream_accessors.h
src/manager/dpl/core/include/dpl/noncopyable.h
src/manager/dpl/core/include/dpl/singleton.h
src/manager/dpl/db/include/dpl/db/sql_connection.h
src/manager/dpl/log/include/dpl/log/log.h
src/manager/sqlcipher/sqlcipher.c

index d198f18..ce4dd6b 100644 (file)
@@ -102,7 +102,7 @@ ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES})
 SET_TARGET_PROPERTIES(
     ${TARGET_KEY_MANAGER_CLIENT}
     PROPERTIES
-        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
+        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
         SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR}
         VERSION ${KEY_MANAGER_CLIENT_VERSION}
     )
@@ -140,7 +140,7 @@ ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CL
 SET_TARGET_PROPERTIES(
     ${TARGET_KEY_MANAGER_CONTROL_CLIENT}
     PROPERTIES
-        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
+        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
         SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR}
         VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION}
     )
index f76b979..f7ec223 100644 (file)
@@ -37,7 +37,7 @@ namespace CKM {
 class Certificate;
 typedef std::shared_ptr<Certificate> CertificateShPtr;
 
-class Certificate {
+class KEY_MANAGER_API Certificate {
 public:
 
     virtual bool empty() const = 0;
index b935784..67250fe 100644 (file)
@@ -34,7 +34,7 @@ class Control;
 typedef std::shared_ptr<Control> ControlShPtr;
 
 // used by login manager to unlock user data with global password
-class Control
+class KEY_MANAGER_API Control
 {
 public:
     // decrypt user key with password
index 6cadb66..718f382 100644 (file)
@@ -28,7 +28,7 @@ namespace CKM {
 class Key;
 typedef std::shared_ptr<Key> KeyShPtr;
 
-class Key {
+class KEY_MANAGER_API Key {
 public:
     virtual bool empty() const = 0;
     virtual KeyType getType() const = 0;
index 6978aaa..bd7b002 100644 (file)
@@ -34,7 +34,7 @@ namespace CKM {
 
 // Asynchronous interface to Central Key Manager. This implementation uses
 // internal thread for connection. Key Manager is not thread safe.
-class ManagerAsync
+class KEY_MANAGER_API ManagerAsync
 {
 public:
     class Impl;
index bf633a6..03b32d3 100644 (file)
@@ -36,7 +36,7 @@ namespace CKM {
 class Manager;
 typedef std::shared_ptr<Manager> ManagerShPtr;
 
-class Manager {
+class KEY_MANAGER_API Manager {
 public:
     virtual ~Manager(){}
 
index 4c2d5b7..c6e043c 100644 (file)
@@ -34,7 +34,7 @@ namespace CKM {
 class PKCS12;
 typedef std::shared_ptr<PKCS12> PKCS12ShPtr;
 
-class PKCS12 {
+class KEY_MANAGER_API PKCS12 {
 public:
     virtual KeyShPtr getKey() const = 0;
 
index 482058d..53b87a7 100644 (file)
@@ -27,6 +27,8 @@
 #include <ckm/ckm-raw-buffer.h>
 #include <ckm/ckm-password.h>
 
+#define KEY_MANAGER_API __attribute__((visibility("default")))
+
 namespace CKM {
 
 // used to pass password and raw key data
index 3b8f93a..2a5d20f 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
  * case, separator " " (space bar) is used to separate label and alias.
  * @see key-manager_doc.h
  */
-extern char const * const ckmc_label_name_separator;
+KEY_MANAGER_CAPI extern char const * const ckmc_label_name_separator;
 
 /**
  * @brief Enumeration for key types of key manager.
index e635b88..8c404f1 100644 (file)
@@ -64,7 +64,7 @@ ADD_LIBRARY(${TARGET_KEY_MANAGER_COMMON} SHARED ${COMMON_SOURCES})
 SET_TARGET_PROPERTIES(
     ${TARGET_KEY_MANAGER_COMMON}
     PROPERTIES
-        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
+        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
         SOVERSION ${KEY_MANAGER_COMMON_VERSION_MAJOR}
         VERSION ${KEY_MANAGER_COMMON_VERSION}
     )
index 715bb2b..8ea2591 100644 (file)
 
 #include <ckmc/ckmc-error.h>
 #include <ckm/ckm-type.h>
+#include <ckmc/ckmc-type.h>
 #include <ckmc-type-converter.h>
 
+KEY_MANAGER_CAPI
 const char * ckmc_error_to_string(int error) {
        return CKM::ErrorToString(to_ckm_error(error));
 }
index cca4458..3325284 100644 (file)
@@ -391,6 +391,7 @@ int ckmc_load_from_pkcs12_file(const char *file_path, const char *passphrase, ck
     return CKMC_ERROR_NONE;
 }
 
+KEY_MANAGER_CAPI
 int ckmc_load_from_pkcs12_file2(const char *file_path, const char *passphrase, ckmc_pkcs12_s **pkcs12_bundle)
 {
     int ec;
index 06cddf7..4d173a7 100644 (file)
@@ -36,8 +36,6 @@
 #include <message-buffer.h>
 #include <protocols.h>
 
-#define KEY_MANAGER_API __attribute__((visibility("default")))
-
 extern "C" {
     struct msghdr;
 }
index 70169cb..cc5f4a5 100644 (file)
 
 #include <ckm/ckm-type.h>
 
+#include <symbol-visibility.h>
+
 struct bio_st;
 typedef bio_st BIO;
 
 namespace CKM {
 
-class Base64Encoder : public CKM::Noncopyable
+class COMMON_API Base64Encoder : public CKM::Noncopyable
 {
   public:
     class Exception
@@ -51,7 +53,7 @@ class Base64Encoder : public CKM::Noncopyable
     bool m_finalized;
 };
 
-class Base64Decoder : public CKM::Noncopyable
+class COMMON_API Base64Decoder : public CKM::Noncopyable
 {
   public:
     class Exception
index b9d053d..3873e7a 100644 (file)
 
 #include <set>
 #include <string>
+#include <symbol-visibility.h>
 
 #pragma once
 
 namespace CKM {
 
-class CertificateConfig
+class COMMON_API CertificateConfig
 {
 public:
     static void addSystemCertificateDir(const std::string& dir) { m_sysCertDirs.insert(dir); }
index 48ae5b7..e66f5ea 100644 (file)
 #include <ckm/ckm-certificate.h>
 
 #include <key-impl.h>
+#include <symbol-visibility.h>
 
 namespace CKM {
 
-class CertificateImpl : public Certificate {
+class COMMON_API CertificateImpl : public Certificate {
 public:
     CertificateImpl() : m_x509(NULL) {}
     explicit CertificateImpl(X509* x509, bool duplicate = true);
index 250e05e..05c4265 100644 (file)
@@ -19,6 +19,7 @@
  * @brief       Certificate Stack Implmentation.
  */
 #include <certificate-impl.h>
+#include <symbol-visibility.h>
 
 extern "C" {
 struct x509_store_st;
@@ -27,7 +28,7 @@ typedef struct x509_store_st X509_STORE;
 
 namespace CKM {
 
-class CertificateStore {
+class COMMON_API CertificateStore {
 public:
     CertificateStore();
     CertificateStore(const CertificateStore &) = delete;
index 6d4df06..44b9f0a 100644 (file)
 #include <dpl/exception.h>
 #include <dpl/raw-buffer.h>
 
+#include <symbol-visibility.h>
+
 // TODO move it to static const int
 #define AES_GCM_TAG_SIZE 16
 
 namespace CKM {
 
-void initCryptoLib();
+COMMON_API void initCryptoLib();
 
 namespace Crypto {
 
@@ -47,7 +49,7 @@ public:
 namespace Cipher {
 
 template<class T>
-struct Base {
+struct COMMON_API Base {
     Base()
       : m_ctx(EVP_CIPHER_CTX_new())
     {
@@ -74,7 +76,7 @@ protected:
 };
 
 template<class T>
-class EvpCipherWrapper : public Base<T> {
+class COMMON_API EvpCipherWrapper : public Base<T> {
 public:
     using Base<T>::m_ctx;
 
@@ -127,7 +129,7 @@ public:
 };
 
 #define DEFINE_CIPHER(__classname, __type, __evpcipher, __encryption) \
-class __classname : public EvpCipherWrapper<__type> {                 \
+class COMMON_API __classname : public EvpCipherWrapper<__type> {                 \
 public:                                                               \
     __classname(const __type &key, const __type &iv)                  \
       : EvpCipherWrapper(__evpcipher, key, iv, __encryption)          \
index 7e166ba..714d6df 100644 (file)
@@ -26,6 +26,7 @@
 #include <dpl/exception.h>
 #include <poll.h>
 #include <noncopyable.h>
+#include <symbol-visibility.h>
 
 namespace CKM {
 
@@ -46,7 +47,7 @@ protected:
 /**
  * @brief Wrapper for poll()
  */
-class DescriptorSet : public IDescriptorSet
+class COMMON_API DescriptorSet : public IDescriptorSet
 {
 public:
     DescriptorSet();
index e890329..a07a79f 100644 (file)
@@ -19,6 +19,7 @@
 #include <dpl/noncopyable.h>
 #include <dpl/exception.h>
 #include <ckm/ckm-type.h>
+#include <symbol-visibility.h>
 
 /*
  * Taken from openssl/ossl_typ.h
@@ -30,7 +31,7 @@ typedef env_md_st EVP_MD;
 
 namespace CKM {
 
-class Digest : public CKM::Noncopyable
+class COMMON_API Digest : public CKM::Noncopyable
 {
     public:
         class Exception
index b56e29a..b2c3ec3 100644 (file)
 #pragma once
 
 #include <noncopyable.h>
+#include <symbol-visibility.h>
 
 namespace CKM {
 
-class FileLock
+class COMMON_API FileLock
 {
 public:
     explicit FileLock(const char* const file);
index 9d7831a..b40c586 100644 (file)
 #include <ckm/ckm-type.h>
 #include <ckm/ckm-key.h>
 #include <openssl/evp.h>
+#include <symbol-visibility.h>
 
 namespace CKM {
 
-class KeyImpl : public Key {
+class COMMON_API KeyImpl : public Key {
 public:
     typedef std::shared_ptr<EVP_PKEY> EvpShPtr;
 
index 4112f43..798056e 100644 (file)
 #include <dpl/binary_queue.h>
 #include <dpl/exception.h>
 #include <dpl/serialization.h>
-
 #include <dpl/raw-buffer.h>
+#include <symbol-visibility.h>
 
 namespace CKM {
 
-class MessageBuffer : public CKM::IStream {
+class COMMON_API MessageBuffer : public CKM::IStream {
 public:
     class Exception
     {
index 6980f5c..9712829 100644 (file)
 #include <memory>
 
 #include <ckm/ckm-pkcs12.h>
+#include <symbol-visibility.h>
 
 namespace CKM {
 
-class PKCS12Impl : public PKCS12 {
+class COMMON_API PKCS12Impl : public PKCS12 {
 public:
     PKCS12Impl() {}
     explicit PKCS12Impl(const PKCS12 &);
index fe1fd53..fa6c8a4 100644 (file)
 
 #include <dpl/exception.h>
 #include <dpl/serialization.h>
+#include <symbol-visibility.h>
 
 namespace CKM {
 
-extern char const * const SERVICE_SOCKET_ECHO;
-extern char const * const SERVICE_SOCKET_CKM_CONTROL;
-extern char const * const SERVICE_SOCKET_CKM_STORAGE;
-extern char const * const SERVICE_SOCKET_OCSP;
+COMMON_API extern char const * const SERVICE_SOCKET_ECHO;
+COMMON_API extern char const * const SERVICE_SOCKET_CKM_CONTROL;
+COMMON_API extern char const * const SERVICE_SOCKET_CKM_STORAGE;
+COMMON_API extern char const * const SERVICE_SOCKET_OCSP;
 
 enum class ControlCommand : int {
     UNLOCK_USER_KEY,
@@ -68,7 +69,7 @@ enum class LogicCommand : int {
     // for backward compatibility append new at the end
 };
 
-class DataType {
+class COMMON_API DataType {
 public:
     class Exception {
     public:
@@ -238,13 +239,13 @@ private:
 };
 
 // (client side) Alias = (service side) Label::Name
-extern char const * const LABEL_NAME_SEPARATOR;
+COMMON_API extern char const * const LABEL_NAME_SEPARATOR;
 typedef std::string Name;
 typedef std::vector<std::pair<Label, Name> > LabelNameVector;
 
 class IStream;
 
-struct PolicySerializable : public Policy, ISerializable {
+struct COMMON_API PolicySerializable : public Policy, ISerializable {
     PolicySerializable() {};
     explicit PolicySerializable(const Policy &policy) : Policy(policy) {}
     explicit PolicySerializable(IStream &stream) {
@@ -257,7 +258,7 @@ struct PolicySerializable : public Policy, ISerializable {
     }
 };
 
-struct PKCS12Serializable : public PKCS12Impl, ISerializable {
+struct COMMON_API PKCS12Serializable : public PKCS12Impl, ISerializable {
     PKCS12Serializable();
     explicit PKCS12Serializable(const PKCS12 &);
     explicit PKCS12Serializable(IStream &);
index 942578b..8c998f0 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef _SMACK_CHECK_H_
 #define _SMACK_CHECK_H_
 
+#include <symbol-visibility.h>
+
 namespace CKM {
 
 /*
@@ -35,6 +37,7 @@ int smack_runtime_check(void);
  * Returns 1 if SMACK is present, 0 otherwise. If SMACK_ENABLED is not defined
  * It returns 0.
  */
+COMMON_API
 int smack_check(void);
 
 } // namespace CKM
diff --git a/src/manager/common/symbol-visibility.h b/src/manager/common/symbol-visibility.h
new file mode 100644 (file)
index 0000000..78cdd5a
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *  Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ *
+ *
+ * @file        symbol-visibility.h
+ * @author      Kyungwook Tak (k.tak@samsung.com)
+ * @version     1.0
+ * @brief       define symbol visiblity for common library.
+ */
+
+#define COMMON_API __attribute__((visibility("default")))
index ad0205d..38ecd81 100644 (file)
 
 #include <dpl/noreturn.h>
 #include <string>
+#include <symbol-visibility.h>
 
 namespace CKM {
 // Assertion handler procedure
 // Do not call directly
 // Always use Assert macro
-CENT_KEY_NORETURN void AssertProc(const char *condition,
+COMMON_API CENT_KEY_NORETURN void AssertProc(const char *condition,
                              const char *file,
                              int line,
                              const char *function);
index 79b3d65..eff8955 100644 (file)
@@ -27,6 +27,7 @@
 #include <dpl/noncopyable.h>
 #include <memory>
 #include <list>
+#include <symbol-visibility.h>
 
 namespace CKM {
 /**
@@ -40,7 +41,7 @@ typedef std::auto_ptr<BinaryQueue> BinaryQueueAutoPtr;
  *
  * @todo Add optimized implementation for FlattenConsume
  */
-class BinaryQueue
+class COMMON_API BinaryQueue
 //  : public AbstractInputOutput
 {
   public:
index 5750425..0ac301f 100644 (file)
 #ifndef CKM_COLORS_H
 #define CKM_COLORS_H
 
+#include <symbol-visibility.h>
+
 namespace CKM {
 namespace Colors {
 namespace Text {
-extern const char* BOLD_GREEN_BEGIN;
-extern const char* BOLD_GREEN_END;
-extern const char* PURPLE_BEGIN;
-extern const char* PURPLE_END;
-extern const char* RED_BEGIN;
-extern const char* RED_END;
-extern const char* GREEN_BEGIN;
-extern const char* GREEN_END;
-extern const char* CYAN_BEGIN;
-extern const char* CYAN_END;
-extern const char* BOLD_RED_BEGIN;
-extern const char* BOLD_RED_END;
-extern const char* BOLD_YELLOW_BEGIN;
-extern const char* BOLD_YELLOW_END;
-extern const char* BOLD_GOLD_BEGIN;
-extern const char* BOLD_GOLD_END;
-extern const char* BOLD_WHITE_BEGIN;
-extern const char* BOLD_WHITE_END;
-extern const char* COLOR_END;
+COMMON_API extern const char* BOLD_GREEN_BEGIN;
+COMMON_API extern const char* BOLD_GREEN_END;
+COMMON_API extern const char* PURPLE_BEGIN;
+COMMON_API extern const char* PURPLE_END;
+COMMON_API extern const char* RED_BEGIN;
+COMMON_API extern const char* RED_END;
+COMMON_API extern const char* GREEN_BEGIN;
+COMMON_API extern const char* GREEN_END;
+COMMON_API extern const char* CYAN_BEGIN;
+COMMON_API extern const char* CYAN_END;
+COMMON_API extern const char* BOLD_RED_BEGIN;
+COMMON_API extern const char* BOLD_RED_END;
+COMMON_API extern const char* BOLD_YELLOW_BEGIN;
+COMMON_API extern const char* BOLD_YELLOW_END;
+COMMON_API extern const char* BOLD_GOLD_BEGIN;
+COMMON_API extern const char* BOLD_GOLD_END;
+COMMON_API extern const char* BOLD_WHITE_BEGIN;
+COMMON_API extern const char* BOLD_WHITE_END;
+COMMON_API extern const char* COLOR_END;
 } //namespace Text
 } //namespace Colors
 } //namespace CKM
index fe93e90..866f6ea 100644 (file)
 #include <dpl/exception.h>
 #include <string>
 #include <cerrno>
+#include <symbol-visibility.h>
 
 namespace CKM {
 DECLARE_EXCEPTION_TYPE(CKM::Exception, InvalidErrnoValue)
 
-std::string GetErrnoString(int error = errno);
+COMMON_API std::string GetErrnoString(int error = errno);
 } // namespace CKM
 
 #endif // CKM_ERRNO_STRING_H
index c2a0ff3..9a2d85d 100644 (file)
 #include <exception>
 #include <cstdlib>
 #include <sstream>
+#include <symbol-visibility.h>
 
 namespace CKM {
-void LogUnhandledException(const std::string &str);
-void LogUnhandledException(const std::string &str,
+COMMON_API void LogUnhandledException(const std::string &str);
+COMMON_API void LogUnhandledException(const std::string &str,
                            const char *filename,
                            int line,
                            const char *function);
 }
 
 namespace CKM {
-class Exception
+class COMMON_API Exception
 {
   private:
     static unsigned int m_exceptionCount;
index b1aa17c..ca0b66d 100644 (file)
@@ -25,6 +25,8 @@
 #ifndef CENT_KEY_FSTREAM_ACCESSORS_H
 #define CENT_KEY_FSTREAM_ACCESSORS_H
 
+#include <symbol-visibility.h>
+
 namespace CKM {
 
 /*
@@ -35,7 +37,7 @@ namespace CKM {
 */
 
 template<typename T>
-class FstreamAccessors : T::__filebuf_type {
+class COMMON_API FstreamAccessors : T::__filebuf_type {
     typedef FstreamAccessors<T> MyType;
 public:
     static int GetFd(T &strm) {
index abc77a3..138a0aa 100644 (file)
 #ifndef CENT_KEY_NONCOPYABLE_H
 #define CENT_KEY_NONCOPYABLE_H
 
+#include <symbol-visibility.h>
+
 namespace CKM {
-class Noncopyable
+class COMMON_API Noncopyable
 {
   private:
     Noncopyable(const Noncopyable &);
index ff713a4..93831aa 100644 (file)
 #ifndef CENT_KEY_SINGLETON_H
 #define CENT_KEY_SINGLETON_H
 
+#include <symbol-visibility.h>
+
 namespace CKM {
 template<typename Class>
-class Singleton :
+class COMMON_API Singleton :
     private Class
 {
     //
index ecec0b0..e657445 100644 (file)
 #include <stdint.h>
 #include <dpl/raw-buffer.h>
 
+#include <symbol-visibility.h>
+
 namespace CKM {
 namespace DB {
 /**
  * SQL connection class
  */
-class SqlConnection
+class COMMON_API SqlConnection
 {
   public:
     /**
index 83fd0d8..ec93e8f 100644 (file)
 #include <sstream>
 #include <list>
 
+#include <symbol-visibility.h>
+
 namespace CKM {
 namespace Log {
 /**
  * CKM log system
  */
-class LogSystem : private Noncopyable
+class COMMON_API LogSystem : private Noncopyable
 {
   public:
     LogSystem();
index 0676c94..a0752e8 100644 (file)
@@ -13059,7 +13059,7 @@ SQLCIPHER_API int sqlcipher3_rekey(sqlcipher3 *db, const void *pKey, int nKey) {
       */
       rc = sqlcipher3BtreeBeginTrans(pDb->pBt, 1); /* begin write transaction */
       sqlcipher3PagerPagecount(pPager, &page_count);
-      for(pgno = 1; rc == SQLCIPHER_OK && pgno <= page_count; pgno++) { /* pgno's start at 1 see pager.c:pagerAcquire */
+      for(pgno = 1; rc == SQLCIPHER_OK && (int)pgno <= page_count; pgno++) { /* pgno's start at 1 see pager.c:pagerAcquire */
         if(!sqlcipher3pager_is_mj_pgno(pPager, pgno)) { /* skip this page (see pager.c:pagerAcquire for reasoning) */
           rc = sqlcipher3PagerGet(pPager, pgno, &page);
           if(rc == SQLCIPHER_OK) { /* write page see pager_incr_changecounter for example */
@@ -57939,7 +57939,7 @@ static int backupOnePage(sqlcipher3_backup *p, Pgno iSrcPg, const u8 *zSrcData){
   if( nSrcReserve!=nDestReserve ){
     u32 newPgsz = nSrcPgsz;
     rc = sqlcipher3PagerSetPagesize(pDestPager, &newPgsz, nSrcReserve);
-    if( rc==SQLCIPHER_OK && newPgsz!=nSrcPgsz ) rc = SQLCIPHER_READONLY;
+    if( rc==SQLCIPHER_OK && (int)newPgsz!=nSrcPgsz ) rc = SQLCIPHER_READONLY;
   }
 #endif
 
@@ -80181,8 +80181,8 @@ static void attachFunc(
   if( rc==SQLCIPHER_OK ){
     extern int sqlcipher3CodecAttach(sqlcipher3*, int, const void*, int);
     extern void sqlcipher3CodecGetKey(sqlcipher3*, int, void**, int*);
-    int nKey;
-    char *zKey;
+    int nKey = 0;
+    char *zKey = NULL;
     int t = sqlcipher3_value_type(argv[2]);
     switch( t ){
       case SQLCIPHER_INTEGER:
@@ -100874,8 +100874,8 @@ SQLCIPHER_PRIVATE int sqlcipher3RunVacuum(char **pzErrMsg, sqlcipher3 *db){
 #ifdef SQLCIPHER_HAS_CODEC
   if( db->nextPagesize ){
     extern void sqlcipher3CodecGetKey(sqlcipher3*, int, void**, int*);
-    int nKey;
-    char *zKey;
+    int nKey = 0;
+    char *zKey = NULL;
     sqlcipher3CodecGetKey(db, 0, (void**)&zKey, &nKey);
     if( nKey ) db->nextPagesize = 0;
   }