Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-336

-spec of crypto:block_encrypt/4 missing one case for aes_gcm

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 19.0
    • Fix Version/s: 19.3
    • Component/s: crypto
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            hans Hans Nilsson
            Reporter:
            sdl.web@gmail.com Leo Liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: