Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Olm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
Olm
Commits
f1cd5613
Commit
f1cd5613
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
Remove the last resort one time key
parent
667e415c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/olm/account.hh
+1
-1
1 addition, 1 deletion
include/olm/account.hh
src/account.cpp
+0
-7
0 additions, 7 deletions
src/account.cpp
src/olm.cpp
+3
-2
3 additions, 2 deletions
src/olm.cpp
with
4 additions
and
10 deletions
include/olm/account.hh
+
1
−
1
View file @
f1cd5613
...
...
@@ -32,9 +32,9 @@ struct LocalKey {
static
std
::
size_t
const
MAX_ONE_TIME_KEYS
=
100
;
struct
Account
{
LocalKey
identity_key
;
LocalKey
last_resort_one_time_key
;
List
<
LocalKey
,
MAX_ONE_TIME_KEYS
>
one_time_keys
;
ErrorCode
last_error
;
...
...
This diff is collapsed.
Click to expand it.
src/account.cpp
+
0
−
7
View file @
f1cd5613
...
...
@@ -58,10 +58,6 @@ std::size_t olm::Account::new_account(
random
+=
32
;
last_resort_one_time_key
.
id
=
++
id
;
olm
::
generate_key
(
random
,
last_resort_one_time_key
.
key
);
random
+=
32
;
for
(
unsigned
i
=
0
;
i
<
10
;
++
i
)
{
LocalKey
&
key
=
*
one_time_keys
.
insert
(
one_time_keys
.
end
());
key
.
id
=
++
id
;
...
...
@@ -110,7 +106,6 @@ std::size_t olm::pickle_length(
)
{
std
::
size_t
length
=
0
;
length
+=
olm
::
pickle_length
(
value
.
identity_key
);
length
+=
olm
::
pickle_length
(
value
.
last_resort_one_time_key
);
length
+=
olm
::
pickle_length
(
value
.
one_time_keys
);
return
length
;
}
...
...
@@ -121,7 +116,6 @@ std::uint8_t * olm::pickle(
olm
::
Account
const
&
value
)
{
pos
=
olm
::
pickle
(
pos
,
value
.
identity_key
);
pos
=
olm
::
pickle
(
pos
,
value
.
last_resort_one_time_key
);
pos
=
olm
::
pickle
(
pos
,
value
.
one_time_keys
);
return
pos
;
}
...
...
@@ -132,7 +126,6 @@ std::uint8_t const * olm::unpickle(
olm
::
Account
&
value
)
{
pos
=
olm
::
unpickle
(
pos
,
end
,
value
.
identity_key
);
pos
=
olm
::
unpickle
(
pos
,
end
,
value
.
last_resort_one_time_key
);
pos
=
olm
::
unpickle
(
pos
,
end
,
value
.
one_time_keys
);
return
pos
;
}
This diff is collapsed.
Click to expand it.
src/olm.cpp
+
3
−
2
View file @
f1cd5613
...
...
@@ -396,11 +396,12 @@ size_t olm_account_one_time_keys(
return
size_t
(
-
1
);
}
std
::
uint8_t
*
output
=
from_c
(
identity_keys
);
output_key
(
from_c
(
account
)
->
last_resort_one_time_key
,
'['
,
output
)
;
std
::
uint8_t
sep
=
'['
;
output
+=
OUTPUT_KEY_LENGTH
;
for
(
auto
const
&
key
:
from_c
(
account
)
->
one_time_keys
)
{
output_key
(
key
,
','
,
output
);
output_key
(
key
,
sep
,
output
);
output
+=
OUTPUT_KEY_LENGTH
;
sep
=
','
;
}
output
[
0
]
=
']'
;
return
length
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment