summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cchecker/app.h21
-rw-r--r--src/include/cchecker/certs.h46
-rw-r--r--src/include/cchecker/logic.h4
-rw-r--r--src/include/cchecker/sql_query.h2
4 files changed, 71 insertions, 2 deletions
diff --git a/src/include/cchecker/app.h b/src/include/cchecker/app.h
index c7dff35..3217bdb 100644
--- a/src/include/cchecker/app.h
+++ b/src/include/cchecker/app.h
@@ -24,10 +24,15 @@
#include <string>
#include <vector>
+#include <list>
#include <sys/types.h>
namespace CCHECKER {
+// Used as app_id when no information about app id in signal
+// Currently in signals from pkgmgr only information about pkg_id is included
+const char *const TEMP_APP_ID = "temp#app_id";
+
struct app_t {
enum class verified_t : int32_t {
NO = 0,
@@ -50,6 +55,22 @@ struct app_t {
std::string str(void) const;
};
+struct url_t {
+ std::string issuer;
+ std::string url;
+ int64_t date;
+
+ url_t(const std::string &_issuer,
+ const std::string &_url,
+ int64_t _date):
+ issuer(_issuer),
+ url(_url),
+ date(_date)
+ {};
+};
+
+typedef std::list<url_t> ocsp_urls_t;
+
} //CCHECKER
#endif //CCHECKER_APP_H
diff --git a/src/include/cchecker/certs.h b/src/include/cchecker/certs.h
new file mode 100644
index 0000000..ed8efe0
--- /dev/null
+++ b/src/include/cchecker/certs.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 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 certs.h
+ * @author Janusz Kozerski (j.kozerski@samsung.com)
+ * @version 1.0
+ * @brief This file is the implementation of certificates logic
+ * Getting out findinf app signature, getting certificates out of
+ * signature. Checking OCSP
+ */
+
+#ifndef CCHECKER_CERTS_H
+#define CCHECKER_CERTS_H
+
+#include <cchecker/app.h>
+
+namespace CCHECKER {
+
+class Certs {
+ public:
+ Certs();
+ virtual ~Certs();
+ void get_certificates (app_t &app, ocsp_urls_t &ocsp_urls);
+ private:
+ void find_app_signatures (app_t &app, const std::string &app_path, ocsp_urls_t &ocsp_urls);
+ void search_app (app_t &app, ocsp_urls_t &ocsp_urls);
+
+};
+
+} // CCHECKER
+
+
+#endif // CCHECKER_CERTS_H
diff --git a/src/include/cchecker/logic.h b/src/include/cchecker/logic.h
index 1f42ab3..d698437 100644
--- a/src/include/cchecker/logic.h
+++ b/src/include/cchecker/logic.h
@@ -31,6 +31,7 @@
#include <thread>
#include <cchecker/app.h>
+#include <cchecker/certs.h>
#include <cchecker/queue.h>
namespace CCHECKER {
@@ -84,7 +85,7 @@ class Logic {
void pkgmanager_uninstall(const app_t &app);
void get_certs_from_signature(const std::string &signature, std::vector<std::string> &cert);
- void add_app_to_buffer(const app_t &app);
+ void add_app_to_buffer_and_database(const app_t &app);
void remove_app_from_buffer(const app_t &app);
void pkgmgr_callback_internal(GVariant *parameters, pkgmgr_event_t event);
@@ -111,6 +112,7 @@ class Logic {
void set_should_exit(void);
Queue m_queue;
+ Certs m_certs;
std::list<app_t> m_buffer;
DB::SqlQuery *m_sqlquery;
bool m_was_setup_called;
diff --git a/src/include/cchecker/sql_query.h b/src/include/cchecker/sql_query.h
index 3996b75..5a22740 100644
--- a/src/include/cchecker/sql_query.h
+++ b/src/include/cchecker/sql_query.h
@@ -23,7 +23,7 @@
#include <list>
#include <string>
-#include <dpl/db/sql_connection.h>
+#include <cchecker/dpl/db/sql_connection.h>
#include <cchecker/app.h>
namespace CCHECKER {