Skip to content

Commit 93ac2fe

Browse files
committed
Fix typo, "<= 23" -> "<= 26"
1 parent 9dd3547 commit 93ac2fe

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

FUNCTIONS/cbor_next_item.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ SELECT
88
WHEN major_type = 0 AND additional_type <= 26 THEN ROW(substring(cbor,2+length_bytes), to_jsonb(data_value))::webauthn.cbor_next
99
WHEN major_type = 1 AND additional_type <= 26 THEN ROW(substring(cbor,2+length_bytes), to_jsonb(-1-data_value))::webauthn.cbor_next
1010
WHEN major_type = 2 AND additional_type <= 26 THEN ROW(substring(cbor,2+length_bytes+data_value), to_jsonb(encode(substring(cbor,2+length_bytes,data_value),'base64')))::webauthn.cbor_next
11-
WHEN major_type = 3 AND additional_type <= 23 THEN ROW(substring(cbor,2+length_bytes+data_value), to_jsonb(convert_from(substring(cbor,2+length_bytes,data_value),'utf8')))::webauthn.cbor_next
12-
WHEN major_type = 4 AND additional_type <= 23 THEN webauthn.cbor_next_array(substring(cbor,2+length_bytes), data_value)
13-
WHEN major_type = 5 AND additional_type <= 23 THEN webauthn.cbor_next_map(substring(cbor,2+length_bytes), data_value)
11+
WHEN major_type = 3 AND additional_type <= 26 THEN ROW(substring(cbor,2+length_bytes+data_value), to_jsonb(convert_from(substring(cbor,2+length_bytes,data_value),'utf8')))::webauthn.cbor_next
12+
WHEN major_type = 4 AND additional_type <= 26 THEN webauthn.cbor_next_array(substring(cbor,2+length_bytes), data_value)
13+
WHEN major_type = 5 AND additional_type <= 26 THEN webauthn.cbor_next_map(substring(cbor,2+length_bytes), data_value)
1414
WHEN major_type = 7 AND additional_type = 20 THEN ROW(substring(cbor,2+0), to_jsonb(false))::webauthn.cbor_next
1515
WHEN major_type = 7 AND additional_type = 21 THEN ROW(substring(cbor,2+0), to_jsonb(true))::webauthn.cbor_next
1616
WHEN major_type = 7 AND additional_type = 22 THEN ROW(substring(cbor,2+0), 'null'::jsonb)::webauthn.cbor_next

sql/ok_decode_cbor.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
BEGIN;
2+
3+
CREATE EXTENSION webauthn CASCADE;
4+
5+
--
6+
-- Real test data from a Yubikey 5Ci
7+
-- Formatted to be used with the online tool http://cbor.me/ for testing
8+
-- a3 63 66 6d 74 66 70 61 63 6b 65 64 67 61 74 74 53 74 6d 74 a3 63 61 6c 67 26 63 73 69 67 58 47 30 45 02 20 14 cc 1a 5a 5b d2 d3 88 ed 1c 65 3f 40 02 ec 49 fb 02 6b 8a c8 b7 f7 cd 53 aa 77 6f 14 80 3d 50 02 21 00 a2 5a 69 12 26 c8 f2 3c c5 15 c5 02 87 42 43 fa ae 4b 1d 0d b0 57 8b cb 90 53 37 a2 ee 08 88 32 63 78 35 63 81 59 02 c1 30 82 02 bd 30 82 01 a5 a0 03 02 01 02 02 04 0a 64 0d 98 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2e 31 2c 30 2a 06 03 55 04 03 13 23 59 75 62 69 63 6f 20 55 32 46 20 52 6f 6f 74 20 43 41 20 53 65 72 69 61 6c 20 34 35 37 32 30 30 36 33 31 30 20 17 0d 31 34 30 38 30 31 30 30 30 30 30 30 5a 18 0f 32 30 35 30 30 39 30 34 30 30 30 30 30 30 5a 30 6e 31 0b 30 09 06 03 55 04 06 13 02 53 45 31 12 30 10 06 03 55 04 0a 0c 09 59 75 62 69 63 6f 20 41 42 31 22 30 20 06 03 55 04 0b 0c 19 41 75 74 68 65 6e 74 69 63 61 74 6f 72 20 41 74 74 65 73 74 61 74 69 6f 6e 31 27 30 25 06 03 55 04 03 0c 1e 59 75 62 69 63 6f 20 55 32 46 20 45 45 20 53 65 72 69 61 6c 20 31 37 34 33 32 39 32 34 30 30 59 30 13 06 07 2a 86 48 ce 3d 02 01 06 08 2a 86 48 ce 3d 03 01 07 03 42 00 04 a1 16 75 6e b4 f0 c7 44 4a af 7d 2e a1 0d 11 c8 f0 2f 49 2c 57 e3 6e 05 0a a1 7f 7c 5a 30 76 0a a0 ef 98 79 20 3c 09 c9 0c 96 a7 e5 38 f6 07 69 3d cf 8f 62 f0 93 86 05 1b ee 17 59 64 fb 63 1d a3 6c 30 6a 30 22 06 09 2b 06 01 04 01 82 c4 0a 02 04 15 31 2e 33 2e 36 2e 31 2e 34 2e 31 2e 34 31 34 38 32 2e 31 2e 37 30 13 06 0b 2b 06 01 04 01 82 e5 1c 02 01 01 04 04 03 02 02 24 30 21 06 0b 2b 06 01 04 01 82 e5 1c 01 01 04 04 12 04 10 c5 ef 55 ff ad 9a 4b 9f b5 80 ad eb af e0 26 d0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 82 01 01 00 2d 45 86 27 61 49 cb f0 94 83 85 2a 5f 1d b6 b8 16 fa a0 d2 38 06 2a e7 8b a3 3b ca f5 aa fa db e1 c2 a7 9c 9e 7a 5c b5 f0 3e 3a c8 d6 c0 9a e6 59 68 f0 77 69 0b f0 ea 29 28 3a b9 f1 1b bc 94 67 de f8 fa 22 6b fa 08 93 ba aa a3 55 b4 c2 f0 52 d2 c8 de ca 59 8a 17 db 01 08 f6 ae f0 14 99 0a 87 d5 d7 79 71 b5 be 8f d4 78 e6 2c c0 bb 96 4e 4b 87 9c 0a 7b 37 fa 07 bc 93 51 2b 12 d0 d0 07 f8 5f a0 67 b7 a4 17 3d b4 5f ae 0b ef 1e 86 e2 34 a1 d7 bd 97 0b e7 2d fe d3 90 af 1e 37 03 59 7a f1 1e da eb 2f 15 7a 99 36 8a 03 3d 25 17 e0 b5 87 11 38 6e e7 4a 32 3c 80 0b ea cc 54 e4 2b 22 a3 b8 86 8e 77 5f 48 b2 a3 de da b0 ce 1a e8 dc 2b 71 df 89 1e 78 32 10 6b 1a 43 f1 97 e8 38 e1 5a 1b 51 e0 f2 a2 3d a4 87 c5 0b 28 05 06 36 0b c1 d8 27 ad f8 32 fb f9 a2 0e 8e 14 3a 90 68 61 75 74 68 44 61 74 61 58 c4 49 96 0d e5 88 0e 8c 68 74 34 17 0f 64 76 60 5b 8f e4 ae b9 a2 86 32 c7 99 5c f3 ba 83 1d 97 63 45 00 00 00 02 c5 ef 55 ff ad 9a 4b 9f b5 80 ad eb af e0 26 d0 00 40 0f 17 4c f2 be b2 b3 ff d8 1e fa 7e a2 63 85 81 f0 18 ce 5e 76 f6 34 d8 45 fb 73 46 63 61 07 f1 ea 0d eb 27 bd ef 98 cb da 24 e3 3c c7 cf 83 44 bb b0 20 c5 24 8c 98 5f 3c 5b a6 e1 69 ae cb 2c a5 01 02 03 26 20 01 21 58 20 92 1c 4f 63 a5 df 7a d5 9e fb 3e 90 29 31 60 88 5b 3e 5e 30 b3 18 2d c8 5c 01 77 72 d8 fb b0 15 22 58 20 50 3b 48 f4 78 67 d4 71 b2 cd 73 fa 9a 72 14 f8 a8 76 ab da a0 18 7a c3 bc 3b d3 84 98 7f 40 af
9+
--
10+
11+
\x
12+
13+
SELECT * FROM webauthn.cbor_to_json('\xa363666d74667061636b65646761747453746d74a363616c67266373696758473045022014cc1a5a5bd2d388ed1c653f4002ec49fb026b8ac8b7f7cd53aa776f14803d50022100a25a691226c8f23cc515c502874243faae4b1d0db0578bcb905337a2ee08883263783563815902c1308202bd308201a5a00302010202040a640d98300d06092a864886f70d01010b0500302e312c302a0603550403132359756269636f2055324620526f6f742043412053657269616c203435373230303633313020170d3134303830313030303030305a180f32303530303930343030303030305a306e310b300906035504061302534531123010060355040a0c0959756269636f20414231223020060355040b0c1941757468656e74696361746f72204174746573746174696f6e3127302506035504030c1e59756269636f205532462045452053657269616c203137343332393234303059301306072a8648ce3d020106082a8648ce3d03010703420004a116756eb4f0c7444aaf7d2ea10d11c8f02f492c57e36e050aa17f7c5a30760aa0ef9879203c09c90c96a7e538f607693dcf8f62f09386051bee175964fb631da36c306a302206092b0601040182c40a020415312e332e362e312e342e312e34313438322e312e373013060b2b0601040182e51c0201010404030202243021060b2b0601040182e51c01010404120410c5ef55ffad9a4b9fb580adebafe026d0300c0603551d130101ff04023000300d06092a864886f70d01010b050003820101002d4586276149cbf09483852a5f1db6b816faa0d238062ae78ba33bcaf5aafadbe1c2a79c9e7a5cb5f03e3ac8d6c09ae65968f077690bf0ea29283ab9f11bbc9467def8fa226bfa0893baaaa355b4c2f052d2c8deca598a17db0108f6aef014990a87d5d77971b5be8fd478e62cc0bb964e4b879c0a7b37fa07bc93512b12d0d007f85fa067b7a4173db45fae0bef1e86e234a1d7bd970be72dfed390af1e3703597af11edaeb2f157a99368a033d2517e0b58711386ee74a323c800beacc54e42b22a3b8868e775f48b2a3dedab0ce1ae8dc2b71df891e7832106b1a43f197e838e15a1b51e0f2a23da487c50b280506360bc1d827adf832fbf9a20e8e143a9068617574684461746158c449960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97634500000002c5ef55ffad9a4b9fb580adebafe026d000400f174cf2beb2b3ffd81efa7ea2638581f018ce5e76f634d845fb7346636107f1ea0deb27bdef98cbda24e33cc7cf8344bbb020c5248c985f3c5ba6e169aecb2ca5010203262001215820921c4f63a5df7ad59efb3e90293160885b3e5e30b3182dc85c017772d8fbb015225820503b48f47867d471b2cd73fa9a7214f8a876abdaa0187ac3bc3bd384987f40af'::bytea);
14+
15+
ROLLBACK;

0 commit comments

Comments
 (0)