Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mtxclient
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
mtxclient
Commits
a80c6d00
Commit
a80c6d00
authored
6 years ago
by
Konstantinos Sideris
Browse files
Options
Downloads
Patches
Plain Diff
Don't depend on private libolm headers
parent
be423a67
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/mtxclient/crypto/client.hpp
+0
-7
0 additions, 7 deletions
include/mtxclient/crypto/client.hpp
lib/crypto/client.cpp
+0
-31
0 additions, 31 deletions
lib/crypto/client.cpp
with
0 additions
and
38 deletions
include/mtxclient/crypto/client.hpp
+
0
−
7
View file @
a80c6d00
...
...
@@ -204,13 +204,6 @@ private:
std
::
unique_ptr
<
OlmUtility
,
OlmDeleter
>
utility_
;
};
std
::
string
encode_base64
(
const
uint8_t
*
data
,
std
::
size_t
len
);
//! Decode the given base64 string
BinaryBuf
decode_base64
(
const
std
::
string
&
data
);
//! Retrieve the session id.
std
::
string
session_id
(
OlmOutboundGroupSession
*
s
);
...
...
This diff is collapsed.
Click to expand it.
lib/crypto/client.cpp
+
0
−
31
View file @
a80c6d00
...
...
@@ -3,7 +3,6 @@
#include
"mtxclient/crypto/client.hpp"
#include
"spdlog/spdlog.h"
#include
<olm/base64.hh>
namespace
{
auto
logger
=
spdlog
::
stdout_color_mt
(
"crypto"
);
...
...
@@ -374,36 +373,6 @@ OlmClient::save(const std::string &key)
return
pickle
<
AccountObject
>
(
account
(),
key
);
}
BinaryBuf
mtx
::
crypto
::
decode_base64
(
const
std
::
string
&
msg
)
{
const
int
output_nbytes
=
olm
::
decode_base64_length
(
msg
.
size
());
if
(
output_nbytes
==
-
1
)
throw
std
::
runtime_error
(
"invalid base64 input length"
);
auto
output_buf
=
create_buffer
(
output_nbytes
);
olm
::
decode_base64
(
reinterpret_cast
<
const
uint8_t
*>
(
msg
.
data
()),
msg
.
size
(),
output_buf
.
data
());
return
output_buf
;
}
std
::
string
mtx
::
crypto
::
encode_base64
(
const
uint8_t
*
data
,
std
::
size_t
len
)
{
const
int
output_nbytes
=
olm
::
encode_base64_length
(
len
);
if
(
output_nbytes
==
-
1
)
throw
std
::
runtime_error
(
"invalid base64 input length"
);
auto
output_buf
=
create_buffer
(
output_nbytes
);
olm
::
encode_base64
(
data
,
len
,
output_buf
.
data
());
return
std
::
string
(
output_buf
.
begin
(),
output_buf
.
end
());
}
std
::
string
mtx
::
crypto
::
session_id
(
OlmOutboundGroupSession
*
s
)
{
...
...
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