aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/olm-sdk/src/main/jni/olm_pk.cpp10
-rw-r--r--include/olm/olm.h28
-rw-r--r--javascript/.gitignore1
-rw-r--r--src/pk.cpp2
4 files changed, 18 insertions, 23 deletions
diff --git a/android/olm-sdk/src/main/jni/olm_pk.cpp b/android/olm-sdk/src/main/jni/olm_pk.cpp
index 12528de..dce62d8 100644
--- a/android/olm-sdk/src/main/jni/olm_pk.cpp
+++ b/android/olm-sdk/src/main/jni/olm_pk.cpp
@@ -366,7 +366,7 @@ JNIEXPORT void OLM_PK_DECRYPTION_FUNC_DEF(releasePkDecryptionJni)(JNIEnv *env, j
JNIEXPORT jbyteArray OLM_PK_DECRYPTION_FUNC_DEF(generateKeyJni)(JNIEnv *env, jobject thiz)
{
- size_t randomLength = olm_pk_generate_key_random_length();
+ size_t randomLength = olm_pk_private_key_length();
uint8_t *randomBuffPtr = NULL;
jbyteArray publicKeyRet = 0;
@@ -393,7 +393,7 @@ JNIEXPORT jbyteArray OLM_PK_DECRYPTION_FUNC_DEF(generateKeyJni)(JNIEnv *env, job
}
else
{
- if (olm_pk_generate_key(decryptionPtr, publicKeyPtr, publicKeyLength, randomBuffPtr, randomLength) == olm_error())
+ if (olm_pk_key_from_private(decryptionPtr, publicKeyPtr, publicKeyLength, randomBuffPtr, randomLength) == olm_error())
{
errorMessage = olm_pk_decryption_last_error(decryptionPtr);
LOGE("## pkGenerateKeyJni(): failure - olm_pk_generate_key Msg=%s", errorMessage);
@@ -414,12 +414,6 @@ JNIEXPORT jbyteArray OLM_PK_DECRYPTION_FUNC_DEF(generateKeyJni)(JNIEnv *env, job
if (errorMessage)
{
- // release the allocated data
- if (decryptionPtr)
- {
- olm_clear_pk_decryption(decryptionPtr);
- free(decryptionPtr);
- }
env->ThrowNew(env->FindClass("java/lang/Exception"), errorMessage);
}
diff --git a/include/olm/olm.h b/include/olm/olm.h
index 793aa30..0722d79 100644
--- a/include/olm/olm.h
+++ b/include/olm/olm.h
@@ -320,13 +320,13 @@ int olm_session_has_received_message(
/** Checks if the PRE_KEY message is for this in-bound session. This can happen
* if multiple messages are sent to this account before this account sends a
- * message in reply. Returns 1 if the session matches. Returns 0 if the session
- * does not match. Returns olm_error() on failure. If the base64
- * couldn't be decoded then olm_session_last_error will be "INVALID_BASE64".
- * If the message was for an unsupported protocol version then
- * olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message
- * couldn't be decoded then then olm_session_last_error() will be
- * "BAD_MESSAGE_FORMAT". */
+ * message in reply. The one_time_key_message buffer is destroyed. Returns 1 if
+ * the session matches. Returns 0 if the session does not match. Returns
+ * olm_error() on failure. If the base64 couldn't be decoded then
+ * olm_session_last_error will be "INVALID_BASE64". If the message was for an
+ * unsupported protocol version then olm_session_last_error() will be
+ * "BAD_MESSAGE_VERSION". If the message couldn't be decoded then then
+ * olm_session_last_error() will be "BAD_MESSAGE_FORMAT". */
size_t olm_matches_inbound_session(
OlmSession * session,
void * one_time_key_message, size_t message_length
@@ -334,13 +334,13 @@ size_t olm_matches_inbound_session(
/** Checks if the PRE_KEY message is for this in-bound session. This can happen
* if multiple messages are sent to this account before this account sends a
- * message in reply. Returns 1 if the session matches. Returns 0 if the session
- * does not match. Returns olm_error() on failure. If the base64
- * couldn't be decoded then olm_session_last_error will be "INVALID_BASE64".
- * If the message was for an unsupported protocol version then
- * olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message
- * couldn't be decoded then then olm_session_last_error() will be
- * "BAD_MESSAGE_FORMAT". */
+ * message in reply. The one_time_key_message buffer is destroyed. Returns 1 if
+ * the session matches. Returns 0 if the session does not match. Returns
+ * olm_error() on failure. If the base64 couldn't be decoded then
+ * olm_session_last_error will be "INVALID_BASE64". If the message was for an
+ * unsupported protocol version then olm_session_last_error() will be
+ * "BAD_MESSAGE_VERSION". If the message couldn't be decoded then then
+ * olm_session_last_error() will be "BAD_MESSAGE_FORMAT". */
size_t olm_matches_inbound_session_from(
OlmSession * session,
void const * their_identity_key, size_t their_identity_key_length,
diff --git a/javascript/.gitignore b/javascript/.gitignore
index 3437f73..1533e1b 100644
--- a/javascript/.gitignore
+++ b/javascript/.gitignore
@@ -2,5 +2,6 @@
/node_modules
/npm-debug.log
/olm.js
+/olm_legacy.js
/olm.wasm
/reports
diff --git a/src/pk.cpp b/src/pk.cpp
index 5cfcea2..8db958a 100644
--- a/src/pk.cpp
+++ b/src/pk.cpp
@@ -70,7 +70,7 @@ size_t olm_pk_encryption_set_recipient_key (
) {
if (key_length < olm_pk_key_length()) {
encryption->last_error =
- OlmErrorCode::OLM_OUTPUT_BUFFER_TOO_SMALL; // FIXME:
+ OlmErrorCode::OLM_INPUT_BUFFER_TOO_SMALL;
return std::size_t(-1);
}
olm::decode_base64(