File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 402
402
pem , signature = server_cert :pem (), server_cert :getsignaturename ()
403
403
end
404
404
signature = signature :lower ()
405
- local _ , with_sig
406
- _ , _ , with_sig = signature :find (" %-with%-(.*)" )
407
- if with_sig then
408
- signature = with_sig
409
- end
410
405
if signature :match (" ^md5" ) or signature :match (" ^sha1" ) or signature :match (" sha1$" ) then
411
406
signature = " sha256"
407
+ else
408
+ local objects = require (" resty.openssl.objects" )
409
+ local sigid = assert (objects .txt2nid (signature ))
410
+ local digest_nid = assert (objects .find_sigid_algs (sigid ))
411
+ signature = assert (objects .nid2table (digest_nid ).sn )
412
412
end
413
413
cbind_data = assert (x509_digest (pem , signature ))
414
414
end
Original file line number Diff line number Diff line change @@ -406,14 +406,14 @@ class Postgres
406
406
407
407
signature = signature\ lower!
408
408
409
- -- Handle the case when the signature is e.g. ECDSA-with-SHA384
410
- _, _, with_sig = signature\ find( " %-with%-(.*)" )
411
- if with_sig
412
- signature = with_sig
413
-
414
409
-- upgrade the signature if necessary (also handle the case of s/RSA-SHA1/sha256)
415
410
if signature\ match( " ^md5" ) or signature\ match( " ^sha1" ) or signature\ match( " sha1$" )
416
411
signature = " sha256"
412
+ else
413
+ objects = require " resty.openssl.objects"
414
+ sigid = assert objects. txt2nid( signature)
415
+ digest_nid = assert objects. find_sigid_algs( sigid)
416
+ signature = assert objects. nid2table( digest_nid) . sn
417
417
418
418
assert x509_digest( pem, signature)
419
419
You can’t perform that action at this time.
0 commit comments