Improve error on a signature certificate with no or broken auth
This commit is contained in:
parent
b14830e4e3
commit
c7465479a2
@ -94,6 +94,14 @@ o.authorizedByCert = function(cert, auth) {
|
||||
throw new Error("Unsupported certificate version " + cert.version);
|
||||
}
|
||||
|
||||
if ( ! cert.auth ) {
|
||||
throw new Error("No certificate authorization");
|
||||
}
|
||||
|
||||
if ( ! cert.auth.method ) {
|
||||
throw new Error("No certificate authorization method");
|
||||
}
|
||||
|
||||
// Open authentication certificates are always authorized
|
||||
if ( cert.auth.method === 'open' ) return true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user