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
0757e6df
Commit
0757e6df
authored
5 years ago
by
Hubert Chathi
Browse files
Options
Downloads
Patches
Plain Diff
add comment about input buffers being overwritten
also make some params const where possible
parent
769d013e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/olm/sas.h
+6
-4
6 additions, 4 deletions
include/olm/sas.h
src/sas.c
+2
-2
2 additions, 2 deletions
src/sas.c
with
8 additions
and
6 deletions
include/olm/sas.h
+
6
−
4
View file @
0757e6df
...
...
@@ -59,7 +59,8 @@ size_t olm_create_sas_random_length(
/** Creates a new SAS object.
*
* @param[in] sas the SAS object to create, initialized by `olm_sas()`.
* @param[in] random array of random bytes.
* @param[in] random array of random bytes. The contents of the buffer may be
* overwritten.
* @param[in] random_length the number of random bytes provided. Must be at
* least `olm_create_sas_random_length()`.
*
...
...
@@ -92,7 +93,8 @@ size_t olm_sas_get_pubkey(
/** Sets the public key of other user.
*
* @param[in] sas the SAS object.
* @param[in] their_key the other user's public key.
* @param[in] their_key the other user's public key. The contents of the
* buffer will be overwritten.
* @param[in] their_key_length the size of the `their_key` buffer.
*
* @return `olm_error()` on failure. If the `their_key` buffer is too small,
...
...
@@ -142,7 +144,7 @@ size_t olm_sas_mac_length(
*/
size_t
olm_sas_calculate_mac
(
OlmSAS
*
sas
,
void
*
input
,
size_t
input_length
,
const
void
*
input
,
size_t
input_length
,
const
void
*
info
,
size_t
info_length
,
void
*
mac
,
size_t
mac_length
);
...
...
@@ -150,7 +152,7 @@ size_t olm_sas_calculate_mac(
// for compatibility with an old version of Riot
size_t
olm_sas_calculate_mac_long_kdf
(
OlmSAS
*
sas
,
void
*
input
,
size_t
input_length
,
const
void
*
input
,
size_t
input_length
,
const
void
*
info
,
size_t
info_length
,
void
*
mac
,
size_t
mac_length
);
...
...
This diff is collapsed.
Click to expand it.
src/sas.c
+
2
−
2
View file @
0757e6df
...
...
@@ -120,7 +120,7 @@ size_t olm_sas_mac_length(
size_t
olm_sas_calculate_mac
(
OlmSAS
*
sas
,
void
*
input
,
size_t
input_length
,
const
void
*
input
,
size_t
input_length
,
const
void
*
info
,
size_t
info_length
,
void
*
mac
,
size_t
mac_length
)
{
...
...
@@ -143,7 +143,7 @@ size_t olm_sas_calculate_mac(
// for compatibility with an old version of Riot
size_t
olm_sas_calculate_mac_long_kdf
(
OlmSAS
*
sas
,
void
*
input
,
size_t
input_length
,
const
void
*
input
,
size_t
input_length
,
const
void
*
info
,
size_t
info_length
,
void
*
mac
,
size_t
mac_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