improve SEA Cert security, still need much improvement in check.pub, unfinished

This commit is contained in:
MIMIZA 2020-10-26 23:53:04 +07:00
parent be6dcf0f99
commit 37da3cc8ea

7
sea.js
View File

@ -1335,10 +1335,9 @@
// even if cert exists, we must verify it
if (cert && cert.m && cert.s) {
SEA.verify(cert, pub, data => {
if (u !== data) {
msg.put[':']['+'] = cert // '+' is a certificate
msg.put[':']['*'] = user.is.pub // '*' is pub of the user who puts
}
if (u === data) return no("Certificate verification fail.")
msg.put[':']['+'] = cert // '+' is a certificate
msg.put[':']['*'] = user.is.pub // '*' is pub of the user who puts
msg.put[':'] = JSON.stringify(msg.put[':'])
return eve.to.next(msg)
})