Skip to content

Commit 0ca5972

Browse files
committed
Drop support for HS512256
1 parent 6d92af0 commit 0ca5972

File tree

7 files changed

+2
-172
lines changed

7 files changed

+2
-172
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
- JWT::EncodedToken#verify! method that bundles signature and claim validation [#647](https://github.com/jwt/ruby-jwt/pull/647) ([@anakinj](https://github.com/anakinj))
1010
- Require token signature to be verified before accessing payload (Breaking change!) [#648](https://github.com/jwt/ruby-jwt/pull/648) ([@anakinj](https://github.com/anakinj))
11+
- Drop support for the HS512256 algorithm (Breaking change!) [#650](https://github.com/jwt/ruby-jwt/pull/650) ([@anakinj](https://github.com/anakinj))
1112
- Your contribution here
1213

1314
**Fixes and enhancements:**

lib/jwt/jwa.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020

2121
require_relative 'jwa/eddsa' if JWT.rbnacl?
2222

23-
if JWT.rbnacl_6_or_greater?
24-
require_relative 'jwa/hmac_rbnacl'
25-
elsif JWT.rbnacl?
26-
require_relative 'jwa/hmac_rbnacl_fixed'
27-
end
28-
2923
module JWT
3024
# The JWA module contains all supported algorithms.
3125
module JWA

lib/jwt/jwa/hmac_rbnacl.rb

Lines changed: 0 additions & 50 deletions
This file was deleted.

lib/jwt/jwa/hmac_rbnacl_fixed.rb

Lines changed: 0 additions & 47 deletions
This file was deleted.

spec/jwt/jwa/hmac_rbnacl_fixed_spec.rb

Lines changed: 0 additions & 51 deletions
This file was deleted.

spec/jwt/jwa/hmac_rbnacl_spec.rb

Lines changed: 0 additions & 13 deletions
This file was deleted.

spec/jwt/jwt_spec.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
'ES256K_public' => test_pkey('ec256k-public.pem'),
2626
'NONE' => 'eyJhbGciOiJub25lIn0.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.',
2727
'HS256' => 'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.kWOVtIOpWcG7JnyJG0qOkTDbOy636XrrQhMm_8JrRQ8',
28-
'HS512256' => 'eyJhbGciOiJIUzUxMjI1NiJ9.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.Ds_4ibvf7z4QOBoKntEjDfthy3WJ-3rKMspTEcHE2bA',
2928
'HS384' => 'eyJhbGciOiJIUzM4NCJ9.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.VuV4j4A1HKhWxCNzEcwc9qVF3frrEu-BRLzvYPkbWO0LENRGy5dOiBQ34remM3XH',
3029
'HS512' => 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.8zNtCBTJIZTHpZ-BkhR-6sZY1K85Nm5YCKqV3AxRdsBJDt_RR-REH2db4T3Y0uQwNknhrCnZGvhNHrvhDwV1kA',
3130
'RS256' => 'eyJhbGciOiJSUzI1NiJ9.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.eSXvWP4GViiwUALj_-qTxU68I1oM0XjgDsCZBBUri2Ghh9d75QkVDoZ_v872GaqunN5A5xcnBK0-cOq-CR6OwibgJWfOt69GNzw5RrOfQ2mz3QI3NYEq080nF69h8BeqkiaXhI24Q51joEgfa9aj5Y-oitLAmtDPYTm7vTcdGufd6AwD3_3jajKBwkh0LPSeMtbe_5EyS94nFoEF9OQuhJYjUmp7agsBVa8FFEjVw5jEgVqkvERSj5hSY4nEiCAomdVxIKBfykyi0d12cgjhI7mBFwWkPku8XIPGZ7N8vpiSLdM68BnUqIK5qR7NAhtvT7iyLFgOqhZNUQ6Ret5VpQ',
@@ -106,10 +105,7 @@
106105
end
107106
end
108107

109-
algorithms = %w[HS256 HS384 HS512]
110-
algorithms << 'HS512256' if JWT.rbnacl?
111-
112-
algorithms.each do |alg|
108+
%w[HS256 HS384 HS512].each do |alg|
113109
context "alg: #{alg}" do
114110
it 'should generate a valid token' do
115111
token = JWT.encode payload, data[:secret], alg

0 commit comments

Comments
 (0)