|
629 | 629 |
|
630 | 630 | context 'when hmac algorithm is used without secret key' do |
631 | 631 | it 'encodes payload' do |
| 632 | + pending 'Different behaviour on OpenSSL 3.0 (https://github.com/openssl/openssl/issues/13089)' if ::JWT.openssl_3? |
632 | 633 | payload = { a: 1, b: 'b' } |
633 | 634 |
|
634 | 635 | token = JWT.encode(payload, '', 'HS256') |
|
644 | 645 | let(:payload) { { 'a' => 1, 'b' => 'b' } } |
645 | 646 |
|
646 | 647 | it 'ignores algorithm casing during encode/decode' do |
647 | | - enc = JWT.encode(payload, '', 'hs256') |
648 | | - expect(JWT.decode(enc, '')).to eq([payload, { 'alg' => 'HS256' }]) |
| 648 | + enc = JWT.encode(payload, 'secret', 'hs256') |
| 649 | + expect(JWT.decode(enc, 'secret')).to eq([payload, { 'alg' => 'HS256' }]) |
649 | 650 |
|
650 | 651 | enc = JWT.encode(payload, data[:rsa_private], 'rs512') |
651 | 652 | expect(JWT.decode(enc, data[:rsa_public], true, algorithm: 'RS512')).to eq([payload, { 'alg' => 'RS512' }]) |
|
759 | 760 | describe 'when token signed with nil and decoded with nil' do |
760 | 761 | let(:no_key_token) { ::JWT.encode(payload, nil, 'HS512') } |
761 | 762 | it 'raises JWT::DecodeError' do |
| 763 | + pending 'Different behaviour on OpenSSL 3.0 (https://github.com/openssl/openssl/issues/13089)' if ::JWT.openssl_3? |
762 | 764 | expect { ::JWT.decode(no_key_token, nil, true, algorithms: 'HS512') }.to raise_error(JWT::DecodeError, 'No verification key available') |
763 | 765 | end |
764 | 766 | end |
|
0 commit comments