From b2c66ac1eb68c7d9bd3839f9a00189e08444274b Mon Sep 17 00:00:00 2001 From: Pete Birkinshaw Date: Wed, 2 Jun 2021 16:46:46 +0100 Subject: [PATCH] New release: 0.2.3 - two small fixes for Erlang/OTP 24 and Elixir 1.12 --- CHANGELOG.md | 8 ++++++++ README.md | 2 +- lib/yubikey_otp/crc.ex | 2 +- lib/yubikey_otp/response.ex | 2 +- mix.exs | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a315c60..9d930a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.3] - 2021-06-02 +Minor fixes for compatibility with Erlang/OTP 24 and Elixir 1.12 + +## Changed +- `YubikeyOTP.CRC.crc16` now does not use deprecated `^^^` operator +- `YubikeyOTP.Response` fixed old bug spotted by new Struct checks in Elixir 1.12 + ## [0.2.2] - 2021-04-21 Fixes to documentation and minor code tweaks @@ -35,6 +42,7 @@ OTP validation and documentation improvements ## [0.1.0] - 2020-04-11 Initial release +[0.2.3]: https://github.com/Digital-Identity-Labs/yubikey_otp/compare/0.2.2...0.2.3 [0.2.2]: https://github.com/Digital-Identity-Labs/yubikey_otp/compare/0.2.1...0.2.2 [0.2.1]: https://github.com/Digital-Identity-Labs/yubikey_otp/compare/0.2.0...0.2.1 [0.2.0]: https://github.com/Digital-Identity-Labs/yubikey_otp/compare/0.1.0...0.2.0 diff --git a/README.md b/README.md index 3365e76..02b01cc 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ dependencies in `mix.exs`: ```elixir def deps do [ - {:yubikey_otp, "~> 0.2.0"} + {:yubikey_otp, "~> 0.2.3"} ] end ``` diff --git a/lib/yubikey_otp/crc.ex b/lib/yubikey_otp/crc.ex index 0e5e064..848af3e 100644 --- a/lib/yubikey_otp/crc.ex +++ b/lib/yubikey_otp/crc.ex @@ -58,7 +58,7 @@ defmodule YubikeyOTP.CRC do |> :binary.bin_to_list |> Enum.reduce(crc, fn c, acc -> - ((acc >>> 8) ^^^ Enum.at(@lookup_table, (acc ^^^ c) &&& 0xff)) &&& 0xffff + (bxor((acc >>> 8), Enum.at(@lookup_table, bxor(acc, c) &&& 0xff))) &&& 0xffff end) end diff --git a/lib/yubikey_otp/response.ex b/lib/yubikey_otp/response.ex index 9f1ef78..5240ef7 100644 --- a/lib/yubikey_otp/response.ex +++ b/lib/yubikey_otp/response.ex @@ -3,7 +3,7 @@ defmodule YubikeyOTP.Response do alias __MODULE__ - @enforce_keys [:otp, :status, :type] + @enforce_keys [:otp, :status] defstruct [ :url, diff --git a/mix.exs b/mix.exs index be92183..01ab70d 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule YubikeyOTP.MixProject do def project do [ app: :yubikey_otp, - version: "0.2.2", + version: "0.2.3", elixir: "~> 1.7", description: "Elixir client library for validating Yubikey one-time-passwords (OTPs)", package: package(),