Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
18
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
cellframe
cellframe-sdk
Commits
6faf624b
Commit
6faf624b
authored
4 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Plain Diff
Merge branch 'feat-4451' into 'master'
Feat 4451 See merge request
!218
parents
a9d3f647
ca3ea32a
No related branches found
No related tags found
4 merge requests
!251
Master
,
!250
Master
,
!220
bugs-4547
,
!218
Feat 4451
Pipeline
#5620
passed with stage
in 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap-sdk/crypto/src/dap_enc_bf.c
+5
-2
5 additions, 2 deletions
dap-sdk/crypto/src/dap_enc_bf.c
with
5 additions
and
2 deletions
dap-sdk/crypto/src/dap_enc_bf.c
+
5
−
2
View file @
6faf624b
...
...
@@ -114,8 +114,11 @@ size_t dap_enc_bf_cbc_decrypt_fast(struct dap_enc_key *a_key, const void * a_in,
a_key
->
priv_key_data
,
iv
,
BF_DECRYPT
);
int
bf_cbc_padding_length
=
*
(
uint8_t
*
)(
a_out
+
a_in_size
-
BLOWFISH_BLOCK_SIZE
-
1
);
size_t
a_out_size
=
*
(
uint32_t
*
)(
a_out
+
a_in_size
-
BLOWFISH_BLOCK_SIZE
-
1
-
bf_cbc_padding_length
-
4
);
if
(
a_out_size
>
a_in_size
+
BLOWFISH_BLOCK_SIZE
)
{
log_it
(
L_WARNING
,
"blowfish_cbc decryption out size %d too big"
,
a_out_size
);
return
a_in_size
+
BLOWFISH_BLOCK_SIZE
;
}
return
a_out_size
;
}
...
...
@@ -126,7 +129,7 @@ size_t dap_enc_bf_cbc_encrypt_fast(struct dap_enc_key * a_key, const void * a_in
//generate iv and put it in *a_out first bytes
size_t
a_out_size
=
(
a_in_size
+
4
+
1
+
BLOWFISH_BLOCK_SIZE
-
1
)
/
BLOWFISH_BLOCK_SIZE
*
BLOWFISH_BLOCK_SIZE
+
BLOWFISH_BLOCK_SIZE
;
if
(
a_out_size
>
buf_out_size
)
{
log_it
(
L_ERROR
,
"blowfish_cbc fast_encryption too small buf_out_size
"
);
log_it
(
L_ERROR
,
"blowfish_cbc fast_encryption too small buf_out_size
, %d < %d"
,
buf_out_size
,
a_out_size
);
return
0
;
}
...
...
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