File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 409
409
end
410
410
if signature :match (" ^md5" ) or signature :match (" ^sha1" ) or signature :match (" sha1$" ) then
411
411
signature = " sha256"
412
+ else
413
+ local objects = require (" resty.openssl.objects" )
414
+ local sigid = assert (objects .txt2nid (signature ))
415
+ local digest_nid = assert (objects .find_sigid_algs (sigid ))
416
+ signature = assert (objects .nid2table (digest_nid ).sn )
412
417
end
413
418
cbind_data = assert (x509_digest (pem , signature ))
414
419
end
Original file line number Diff line number Diff line change @@ -414,6 +414,11 @@ class Postgres
414
414
-- upgrade the signature if necessary (also handle the case of s/RSA-SHA1/sha256)
415
415
if signature\ match( " ^md5" ) or signature\ match( " ^sha1" ) or signature\ match( " sha1$" )
416
416
signature = " sha256"
417
+ else
418
+ local objects = require ( " resty.openssl.objects" )
419
+ local sigid = assert objects. txt2nid( signature)
420
+ local digest_nid = assert objects. find_sigid_algs( sigid)
421
+ signature = assert objects. nid2table( digest_nid) . sn
417
422
418
423
assert x509_digest( pem, signature)
419
424
You can’t perform that action at this time.
0 commit comments