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
c47c6ca3
Commit
c47c6ca3
authored
Sep 16, 2020
by
Hubert Chathi
Browse files
fix style
parent
c45f19f1
Changes
2
Show whitespace changes
Inline
Side-by-side
include/olm/account.hh
View file @
c47c6ca3
...
...
@@ -129,8 +129,7 @@ struct Account {
);
/** The number of random bytes needed to generate a fallback key. */
std
::
size_t
generate_fallback_key_random_length
(
);
std
::
size_t
generate_fallback_key_random_length
();
/** Generates a new fallback key. Returns std::size_t(-1) on error. If the
* number of random bytes is too small then last_error will be
...
...
src/account.cpp
View file @
c47c6ca3
...
...
@@ -38,11 +38,17 @@ olm::OneTimeKey const * olm::Account::lookup_key(
}
}
if
(
current_fallback_key
.
published
&&
olm
::
array_equal
(
current_fallback_key
.
key
.
public_key
.
public_key
,
public_key
.
public_key
))
{
&&
olm
::
array_equal
(
current_fallback_key
.
key
.
public_key
.
public_key
,
public_key
.
public_key
)
)
{
return
&
current_fallback_key
;
}
if
(
prev_fallback_key
.
published
&&
olm
::
array_equal
(
prev_fallback_key
.
key
.
public_key
.
public_key
,
public_key
.
public_key
))
{
&&
olm
::
array_equal
(
prev_fallback_key
.
key
.
public_key
.
public_key
,
public_key
.
public_key
)
)
{
return
&
prev_fallback_key
;
}
return
0
;
...
...
@@ -62,11 +68,17 @@ std::size_t olm::Account::remove_key(
// check if the key is a fallback key, to avoid returning an error, but
// don't actually remove it
if
(
current_fallback_key
.
published
&&
olm
::
array_equal
(
current_fallback_key
.
key
.
public_key
.
public_key
,
public_key
.
public_key
))
{
&&
olm
::
array_equal
(
current_fallback_key
.
key
.
public_key
.
public_key
,
public_key
.
public_key
)
)
{
return
current_fallback_key
.
id
;
}
if
(
prev_fallback_key
.
published
&&
olm
::
array_equal
(
prev_fallback_key
.
key
.
public_key
.
public_key
,
public_key
.
public_key
))
{
&&
olm
::
array_equal
(
prev_fallback_key
.
key
.
public_key
.
public_key
,
public_key
.
public_key
)
)
{
return
prev_fallback_key
.
id
;
}
return
std
::
size_t
(
-
1
);
...
...
Write
Preview
Markdown
is supported
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