Skip to content
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

ERL-336: -spec of crypto:block_encrypt/4 missing one case for aes_gcm #3152

Closed
OTP-Maintainer opened this issue Jan 9, 2017 · 3 comments
Closed
Assignees
Labels
bug Issue is reported as a bug priority:medium team:PS Assigned to OTP team PS
Milestone

Comments

@OTP-Maintainer
Copy link

Original reporter: sdl.web@gmail.com
Affected version: OTP-19.0
Fixed in version: OTP-19.3
Component: crypto
Migrated from: https://bugs.erlang.org/browse/ERL-336


The manual entry of crypto:block_encrypt/4 documents the signature block_encrypt(aes_gcm, Key, Ivec, {AAD, PlainText, TagLength}). But the corresponding -spec in crypto.erl does not. So this can cause some dialyzer error like this:

The call crypto:block_encrypt('aes_gcm',CEK::binary(),Nonce::binary(),{<<>>,_,16}) breaks the contract ('des_cbc' | 'des_cfb' | 'des3_cbc' | 'des3_cbf' | 'des3_cfb' | 'des_ede3' | 'blowfish_cbc' | 'blowfish_cfb64' | 'blowfish_ofb64' | 'aes_cbc128' | 'aes_cfb8' | 'aes_cfb128' | 'aes_cbc256' | 'aes_ige256' | 'aes_cbc' | 'rc2_cbc',Key::iodata(),Ivec::binary(),Data::iodata()) -> binary()
    ; ('aes_gcm' | 'chacha20_poly1305',Key::iodata(),Ivec::binary(),{AAD::binary(),Data::iodata()}) -> {binary(),binary()} in the 4th argument
@OTP-Maintainer
Copy link
Author

hans said:

Correct, but unfortunately other tasks are prioritized for the near future so I can't fix this right now.

Pull-request anyone?

-Hans

@OTP-Maintainer
Copy link
Author

sdl.web@gmail.com said:

I sent in a PR https://github.com/erlang/otp/pull/1311

@OTP-Maintainer
Copy link
Author

hans said:

Merged to maint and master

@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:PS Assigned to OTP team PS priority:medium labels Feb 10, 2021
@OTP-Maintainer OTP-Maintainer added this to the OTP-19.3 milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:medium team:PS Assigned to OTP team PS
Projects
None yet
Development

No branches or pull requests

2 participants