-
Notifications
You must be signed in to change notification settings - Fork 186
Allow kuznyechik-ctr-acpkm-omac PKCS12 integration
#413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yanovich
wants to merge
4
commits into
gost-engine:master
Choose a base branch
from
yanovich:omac-pkcs12
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ecf873d
Allow `kuznyechik-ctr-acpkm-omac` PKCS12 integration
c40bd93
fixup! Allow `kuznyechik-ctr-acpkm-omac` PKCS12 integration
fa4d6b0
fixup! Allow `kuznyechik-ctr-acpkm-omac` PKCS12 integration
e44a4b7
fixup! Allow `kuznyechik-ctr-acpkm-omac` PKCS12 integration
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -871,31 +871,44 @@ static int gost_grasshopper_cipher_ctl(EVP_CIPHER_CTX *ctx, int type, int arg, v | |
| } | ||
| } | ||
| return -1; | ||
| #if 0 | ||
| case EVP_CTRL_AEAD_GET_TAG: | ||
| case EVP_CTRL_AEAD_SET_TAG: | ||
| { | ||
| int taglen = arg; | ||
| unsigned char *tag = ptr; | ||
|
|
||
| gost_grasshopper_cipher_ctx *c = EVP_CIPHER_CTX_get_cipher_data(ctx); | ||
| if (c->c.type != GRASSHOPPER_CIPHER_MGM) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MGM тоже нужен. Или этого #define не сохранилось?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. этот код был под |
||
| gost_grasshopper_cipher_ctx_ctr *c = EVP_CIPHER_CTX_get_cipher_data(ctx); | ||
| if (c->c.type != GRASSHOPPER_CIPHER_CTRACPKMOMAC) | ||
| return -1; | ||
|
|
||
| if (taglen > KUZNYECHIK_MAC_MAX_SIZE) { | ||
| CRYPTOCOMerr(CRYPTOCOM_F_GOST_GRASSHOPPER_CIPHER_CTL, | ||
| CRYPTOCOM_R_INVALID_TAG_LENGTH); | ||
| GOSTerr(GOST_F_GOST_GRASSHOPPER_CIPHER_CTL, GOST_R_BAD_MAC); | ||
| return -1; | ||
| } | ||
|
|
||
| if (type == EVP_CTRL_AEAD_GET_TAG) | ||
| memcpy(tag, c->final_tag, taglen); | ||
| memcpy(tag, c->tag, taglen); | ||
| else | ||
| memcpy(c->final_tag, tag, taglen); | ||
| memcpy(c->tag, tag, taglen); | ||
|
|
||
| return 1; | ||
| } | ||
| #endif | ||
| case EVP_CTRL_AEAD_TLS1_AAD: { | ||
| gost_grasshopper_cipher_ctx_ctr *c = EVP_CIPHER_CTX_get_cipher_data(ctx); | ||
| if (!ptr || c->c.type != GRASSHOPPER_CIPHER_CTRACPKMOMAC) | ||
| return -1; | ||
| if (arg != 0) | ||
| return 0; | ||
| *(int *) ptr = KUZNYECHIK_MAC_MAX_SIZE; | ||
| return 1; | ||
| } | ||
| case EVP_CTRL_PBE_PRF_NID: { | ||
| if (ptr) { | ||
| *((int *)ptr) = NID_id_tc26_hmac_gost_3411_2012_512; | ||
| return 1; | ||
| } | ||
| return 0; | ||
| } | ||
| case EVP_CTRL_PROCESS_UNPROTECTED: | ||
| { | ||
| STACK_OF(X509_ATTRIBUTE) *x = ptr; | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так где сейчас берётся случайный IV?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/gost-engine/engine/blob/master/gost_grasshopper_cipher.c#L218