aboutsummaryrefslogtreecommitdiff
path: root/standalone/src
diff options
context:
space:
mode:
Diffstat (limited to 'standalone/src')
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp11
-rw-r--r--standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp6
2 files changed, 15 insertions, 2 deletions
diff --git a/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp
index ed26c01..0e74ee0 100644
--- a/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cpp_utils.hpp
@@ -47,4 +47,13 @@ void add_ka(JNIEnv *env, const std::string &type, const std::string &klass, jobj
/**
* Add a SignatureSpi class to this provider.
*/
-void add_sig(JNIEnv *env, const std::string &type, const std::string &klass, jobject provider, jmethodID put_method); \ No newline at end of file
+void add_sig(JNIEnv *env, const std::string &type, const std::string &klass, jobject provider, jmethodID put_method);
+
+/**
+ * Version handling.
+ */
+#define VERSION_GT(lib,a,b,c) ((ECTESTER_##lib##_MAJOR == a && ECTESTER_##lib##_MINOR == b && ECTESTER_##lib##_PATCH > c) || (ECTESTER_##lib##_MAJOR == a && ECTESTER_##lib##_MINOR > b) || (ECTESTER_##lib##_MAJOR > a))
+#define VERSION_EQ(lib,a,b,c) (ECTESTER_##lib##_MAJOR == a && ECTESTER_##lib##_MINOR == b && ECTESTER_##lib##_PATCH == c)
+#define VERSION_GE(lib,a,b,c) (VERSION_GT(lib,a,b,c) || VERSION_EQ(lib,a,b,c))
+#define VERSION_LT(lib,a,b,c) !(VERSION_GE(lib,a,b,c))
+#define VERSION_LE(lib,a,b,c) !(VERSION_GT(lib,a,b,c))
diff --git a/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp
index 2cff58c..c194bf6 100644
--- a/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp
+++ b/standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/cryptopp.cpp
@@ -163,7 +163,11 @@ static std::vector<OID> get_all_curve_oids() {
}
static std::string oid_to_str(const OID &oid) {
+#if VERSION_LT(CRYPTOPP, 8, 0, 0)
+ const std::vector<CryptoPP::word32>& oid_values = oid.m_values;
+#else
const std::vector<CryptoPP::word32>& oid_values = oid.GetValues();
+#endif
std::stringstream ss;
for (size_t i = 0; i < oid_values.size(); ++i) {
if(i != 0)
@@ -839,4 +843,4 @@ JNIEXPORT jboolean JNICALL Java_cz_crcs_ectester_standalone_libs_jni_NativeSigna
}
// unreachable
return JNI_FALSE;
-} \ No newline at end of file
+}