diff options
author | Matthew Wild <mwild1@gmail.com> | 2022-07-11 14:30:39 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2022-07-11 14:30:39 +0100 |
commit | e12c9a83df999049970403cbbd6a6427f79f889e (patch) | |
tree | 33c072a98178621723e48a408b78ac42bf9e09bf /spec | |
parent | ae070865028fdee8285e924a63689ad88871ab6b (diff) | |
download | prosody-e12c9a83df999049970403cbbd6a6427f79f889e.tar.gz prosody-e12c9a83df999049970403cbbd6a6427f79f889e.zip |
util.paseto: Drop custom wrappers around key objects
The PASETO spec recommends - no, *requires* - that implementations enforce
type safety for keys, and e.g. do not pass them around as arbitrary byte
strings. Typed wrapper objects are recommended.
I originally followed this advice when starting the lib. However, key wrapping
and type safety is now also a feature of util.crypto. All we're doing is
duplicating it unnecessarily with this additional wrapper code.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/util_paseto_spec.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/util_paseto_spec.lua b/spec/util_paseto_spec.lua index a57cea18..ec30c6a7 100644 --- a/spec/util_paseto_spec.lua +++ b/spec/util_paseto_spec.lua @@ -73,7 +73,7 @@ describe("util.paseto", function () describe("basic sign/verify", function () local function new_keypair() local kp = paseto.v4_public.new_keypair(); - return kp.private_key:export(), kp.public_key:export(); + return kp:private_pem(), kp:public_pem(); end local privkey1, pubkey1 = new_keypair(); |