{"action":"created","issue":{"url":"https://api.github.com/repos/erlang/otp/issues/1138","repository_url":"https://api.github.com/repos/erlang/otp","labels_url":"https://api.github.com/repos/erlang/otp/issues/1138/labels{/name}","comments_url":"https://api.github.com/repos/erlang/otp/issues/1138/comments","events_url":"https://api.github.com/repos/erlang/otp/issues/1138/events","html_url":"https://github.com/erlang/otp/pull/1138","id":168480448,"number":1138,"title":"crypto:cmac calculating the Cipher-based Message Authentication Code (ERL-82)","user":{"login":"gotthardp","id":939979,"avatar_url":"https://avatars.githubusercontent.com/u/939979?v=3","gravatar_id":"","url":"https://api.github.com/users/gotthardp","html_url":"https://github.com/gotthardp","followers_url":"https://api.github.com/users/gotthardp/followers","following_url":"https://api.github.com/users/gotthardp/following{/other_user}","gists_url":"https://api.github.com/users/gotthardp/gists{/gist_id}","starred_url":"https://api.github.com/users/gotthardp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gotthardp/subscriptions","organizations_url":"https://api.github.com/users/gotthardp/orgs","repos_url":"https://api.github.com/users/gotthardp/repos","events_url":"https://api.github.com/users/gotthardp/events{/privacy}","received_events_url":"https://api.github.com/users/gotthardp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/erlang/otp/labels/feature","name":"feature","color":"7159f7"},{"url":"https://api.github.com/repos/erlang/otp/labels/team:PS","name":"team:PS","color":"006b75"},{"url":"https://api.github.com/repos/erlang/otp/labels/testing","name":"testing","color":"e99695"},{"url":"https://api.github.com/repos/erlang/otp/labels/waiting","name":"waiting","color":"c5def5"}],"state":"open","locked":false,"assignee":{"login":"IngelaAndin","id":294507,"avatar_url":"https://avatars.githubusercontent.com/u/294507?v=3","gravatar_id":"","url":"https://api.github.com/users/IngelaAndin","html_url":"https://github.com/IngelaAndin","followers_url":"https://api.github.com/users/IngelaAndin/followers","following_url":"https://api.github.com/users/IngelaAndin/following{/other_user}","gists_url":"https://api.github.com/users/IngelaAndin/gists{/gist_id}","starred_url":"https://api.github.com/users/IngelaAndin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IngelaAndin/subscriptions","organizations_url":"https://api.github.com/users/IngelaAndin/orgs","repos_url":"https://api.github.com/users/IngelaAndin/repos","events_url":"https://api.github.com/users/IngelaAndin/events{/privacy}","received_events_url":"https://api.github.com/users/IngelaAndin/received_events","type":"User","site_admin":false},"assignees":[{"login":"IngelaAndin","id":294507,"avatar_url":"https://avatars.githubusercontent.com/u/294507?v=3","gravatar_id":"","url":"https://api.github.com/users/IngelaAndin","html_url":"https://github.com/IngelaAndin","followers_url":"https://api.github.com/users/IngelaAndin/followers","following_url":"https://api.github.com/users/IngelaAndin/following{/other_user}","gists_url":"https://api.github.com/users/IngelaAndin/gists{/gist_id}","starred_url":"https://api.github.com/users/IngelaAndin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IngelaAndin/subscriptions","organizations_url":"https://api.github.com/users/IngelaAndin/orgs","repos_url":"https://api.github.com/users/IngelaAndin/repos","events_url":"https://api.github.com/users/IngelaAndin/events{/privacy}","received_events_url":"https://api.github.com/users/IngelaAndin/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2016-07-30T18:28:14Z","updated_at":"2016-08-30T13:26:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/erlang/otp/pulls/1138","html_url":"https://github.com/erlang/otp/pull/1138","diff_url":"https://github.com/erlang/otp/pull/1138.diff","patch_url":"https://github.com/erlang/otp/pull/1138.patch"},"body":"The [ERL-82](https://bugs.erlang.org/browse/ERL-82) issue requests a way to calculate a [CMAC](http://csrc.nist.gov/publications/nistpubs/800-38B/SP_800-38B.pdf) in Erlang. The AES128 CMAC is standartized in [RFC 4493](https://tools.ietf.org/html/rfc4493) and used e.g. for message authentication in the [LoRaWAN](https://www.lora-alliance.org/For-Developers/LoRaWANDevelopers) networks.\r\n\r\nThe CMAC is implemented by OpenSSL since v1.0.1, but as @IngelaAndin stated in response to the ERL-82, the current crypto implementation does not include functions that call those OpenSSL cryptolib functions.\r\n\r\nThis commit introduces a new function `crypto:cmac` that calls the corresponding OpenSSL functions and calculates the CMAC.\r\n\r\nOnly the cmac_nif is implemented. The incremental functions (init, update, final) are not provided because the current OpenSSL does not allow custom memory allocators like `enif_alloc_resource`.\r\n\r\nThe `crypto:cmac/4` is implemented for convenience and to keep the API similar to the `crypto:hmac/3` and `crypto:hmac/4`.\r\n\r\nThe Erlang user guide states that at least OpenSSL 0.9.8 is required, so I added few #ifdefs so the code is compatible with all versions. However, the OpenSSL pages say that the pre-1.0.1 versions (0.9.8 and\r\n1.0.0) are no longer maintained. Even the 1.0.1 will be retired by Dec 2016. Hence I believe that adding a 1.0.1-only function like CMAC should be OK."},"comment":{"url":"https://api.github.com/repos/erlang/otp/issues/comments/243437809","html_url":"https://github.com/erlang/otp/pull/1138#issuecomment-243437809","issue_url":"https://api.github.com/repos/erlang/otp/issues/1138","id":243437809,"user":{"login":"IngelaAndin","id":294507,"avatar_url":"https://avatars.githubusercontent.com/u/294507?v=3","gravatar_id":"","url":"https://api.github.com/users/IngelaAndin","html_url":"https://github.com/IngelaAndin","followers_url":"https://api.github.com/users/IngelaAndin/followers","following_url":"https://api.github.com/users/IngelaAndin/following{/other_user}","gists_url":"https://api.github.com/users/IngelaAndin/gists{/gist_id}","starred_url":"https://api.github.com/users/IngelaAndin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IngelaAndin/subscriptions","organizations_url":"https://api.github.com/users/IngelaAndin/orgs","repos_url":"https://api.github.com/users/IngelaAndin/repos","events_url":"https://api.github.com/users/IngelaAndin/events{/privacy}","received_events_url":"https://api.github.com/users/IngelaAndin/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T13:26:47Z","updated_at":"2016-08-30T13:26:47Z","body":"Thank you for the offer of fall back, however we do not want to open up for Erlang implementations of\r\nof cryptographic functions with all responsibility of testing and making sure they are correct and safe to use. We think it is acceptable that it will not work with older versions of OpenSSL. We are ready to accept this PR now."}}
{"actor":{"display_login":"IngelaAndin"}}