Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matrix-org
Olm
Commits
d7bc00c8
Commit
d7bc00c8
authored
Sep 13, 2016
by
Mark Haines
Committed by
GitHub
Sep 13, 2016
Browse files
Merge pull request #23 from matrix-org/markjh/remove_message_index
Remove the messsage index from olm_init_inbound_group_session
parents
1a50a4b3
a628ef41
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/olm/inbound_group_session.h
View file @
d7bc00c8
...
@@ -95,8 +95,6 @@ size_t olm_unpickle_inbound_group_session(
...
@@ -95,8 +95,6 @@ size_t olm_unpickle_inbound_group_session(
*/
*/
size_t
olm_init_inbound_group_session
(
size_t
olm_init_inbound_group_session
(
OlmInboundGroupSession
*
session
,
OlmInboundGroupSession
*
session
,
uint32_t
message_index
,
/* base64-encoded keys */
/* base64-encoded keys */
uint8_t
const
*
session_key
,
size_t
session_key_length
uint8_t
const
*
session_key
,
size_t
session_key_length
);
);
...
...
javascript/olm_inbound_group_session.js
View file @
d7bc00c8
...
@@ -52,12 +52,12 @@ InboundGroupSession.prototype['unpickle'] = restore_stack(function(key, pickle)
...
@@ -52,12 +52,12 @@ InboundGroupSession.prototype['unpickle'] = restore_stack(function(key, pickle)
);
);
});
});
InboundGroupSession
.
prototype
[
'
create
'
]
=
restore_stack
(
function
(
message_index
,
session_key
)
{
InboundGroupSession
.
prototype
[
'
create
'
]
=
restore_stack
(
function
(
session_key
)
{
var
key_array
=
array_from_string
(
session_key
);
var
key_array
=
array_from_string
(
session_key
);
var
key_buffer
=
stack
(
key_array
);
var
key_buffer
=
stack
(
key_array
);
inbound_group_session_method
(
Module
[
'
_olm_init_inbound_group_session
'
])(
inbound_group_session_method
(
Module
[
'
_olm_init_inbound_group_session
'
])(
this
.
ptr
,
message_index
,
key_buffer
,
key_array
.
length
this
.
ptr
,
key_buffer
,
key_array
.
length
);
);
});
});
...
...
python/olm/inbound_group_session.py
View file @
d7bc00c8
...
@@ -33,7 +33,7 @@ inbound_group_session_function(
...
@@ -33,7 +33,7 @@ inbound_group_session_function(
)
)
inbound_group_session_function
(
inbound_group_session_function
(
lib
.
olm_init_inbound_group_session
,
c_uint32
,
c_void_p
,
c_size_t
lib
.
olm_init_inbound_group_session
,
c_void_p
,
c_size_t
)
)
inbound_group_session_function
(
inbound_group_session_function
(
...
@@ -69,10 +69,10 @@ class InboundGroupSession(object):
...
@@ -69,10 +69,10 @@ class InboundGroupSession(object):
self
.
ptr
,
key_buffer
,
len
(
key
),
pickle_buffer
,
len
(
pickle
)
self
.
ptr
,
key_buffer
,
len
(
key
),
pickle_buffer
,
len
(
pickle
)
)
)
def
init
(
self
,
message_index
,
session_key
):
def
init
(
self
,
session_key
):
key_buffer
=
create_string_buffer
(
session_key
)
key_buffer
=
create_string_buffer
(
session_key
)
lib
.
olm_init_inbound_group_session
(
lib
.
olm_init_inbound_group_session
(
self
.
ptr
,
message_index
,
key_buffer
,
len
(
session_key
)
self
.
ptr
,
key_buffer
,
len
(
session_key
)
)
)
def
decrypt
(
self
,
message
):
def
decrypt
(
self
,
message
):
...
...
src/inbound_group_session.c
View file @
d7bc00c8
...
@@ -114,7 +114,6 @@ static size_t _init_group_session_keys(
...
@@ -114,7 +114,6 @@ static size_t _init_group_session_keys(
size_t
olm_init_inbound_group_session
(
size_t
olm_init_inbound_group_session
(
OlmInboundGroupSession
*
session
,
OlmInboundGroupSession
*
session
,
uint32_t
message_index
,
const
uint8_t
*
session_key
,
size_t
session_key_length
const
uint8_t
*
session_key
,
size_t
session_key_length
)
{
)
{
uint8_t
key_buf
[
SESSION_KEY_RAW_LENGTH
];
uint8_t
key_buf
[
SESSION_KEY_RAW_LENGTH
];
...
...
tests/test_group_session.cpp
View file @
d7bc00c8
...
@@ -130,7 +130,7 @@ int main() {
...
@@ -130,7 +130,7 @@ int main() {
olm_inbound_group_session
(
inbound_session_memory
);
olm_inbound_group_session
(
inbound_session_memory
);
res
=
olm_init_inbound_group_session
(
res
=
olm_init_inbound_group_session
(
inbound_session
,
0U
,
session_key
,
session_key_len
);
inbound_session
,
session_key
,
session_key_len
);
assert_equals
((
size_t
)
0
,
res
);
assert_equals
((
size_t
)
0
,
res
);
...
@@ -192,7 +192,7 @@ int main() {
...
@@ -192,7 +192,7 @@ int main() {
olm_inbound_group_session
(
inbound_session_memory
);
olm_inbound_group_session
(
inbound_session_memory
);
size_t
res
=
olm_init_inbound_group_session
(
size_t
res
=
olm_init_inbound_group_session
(
inbound_session
,
0U
,
session_key
,
sizeof
(
session_key
)
-
1
inbound_session
,
session_key
,
sizeof
(
session_key
)
-
1
);
);
assert_equals
((
size_t
)
0
,
res
);
assert_equals
((
size_t
)
0
,
res
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment