diff options
author | Kai Michaelis <[email protected]> | 2016-08-10 17:51:42 +0200 |
---|---|---|
committer | seu <[email protected]> | 2016-10-02 18:10:32 +0200 |
commit | cc5bca63e7e7b4ae1650e9f468e3c1a00623579f (patch) | |
tree | 1777abf62fc7e3e4a2dce8d3c8c87449f9b46816 /src/lib/utils/sqlite3 | |
parent | 9ba36a7097f29ee54a88e34f38e3bc9842accea6 (diff) |
Certificate store using SQLite
Diffstat (limited to 'src/lib/utils/sqlite3')
-rw-r--r-- | src/lib/utils/sqlite3/sqlite3.cpp | 7 | ||||
-rw-r--r-- | src/lib/utils/sqlite3/sqlite3.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/utils/sqlite3/sqlite3.cpp b/src/lib/utils/sqlite3/sqlite3.cpp index 77b4c0d10..251cbcdf5 100644 --- a/src/lib/utils/sqlite3/sqlite3.cpp +++ b/src/lib/utils/sqlite3/sqlite3.cpp @@ -99,6 +99,13 @@ void Sqlite3_Database::Sqlite3_Statement::bind(int column, const std::vector<byt throw SQL_DB_Error("sqlite3_bind_text failed, code " + std::to_string(rc)); } +void Sqlite3_Database::Sqlite3_Statement::bind(int column, const byte* p, size_t len) + { + int rc = ::sqlite3_bind_blob(m_stmt, column, p, len, SQLITE_TRANSIENT); + if(rc != SQLITE_OK) + throw SQL_DB_Error("sqlite3_bind_text failed, code " + std::to_string(rc)); + } + std::pair<const byte*, size_t> Sqlite3_Database::Sqlite3_Statement::get_blob(int column) { BOTAN_ASSERT(::sqlite3_column_type(m_stmt, 0) == SQLITE_BLOB, diff --git a/src/lib/utils/sqlite3/sqlite3.h b/src/lib/utils/sqlite3/sqlite3.h index 067b94e85..659e1c487 100644 --- a/src/lib/utils/sqlite3/sqlite3.h +++ b/src/lib/utils/sqlite3/sqlite3.h @@ -35,6 +35,7 @@ class BOTAN_DLL Sqlite3_Database : public SQL_Database void bind(int column, size_t val) override; void bind(int column, std::chrono::system_clock::time_point time) override; void bind(int column, const std::vector<byte>& val) override; + void bind(int column, const byte* data, size_t len) override; std::pair<const byte*, size_t> get_blob(int column) override; size_t get_size_t(int column) override; |