diff --git a/verifier/lib/idassertion.js b/verifier/lib/idassertion.js index 642d702e79016a62f511cbfbd52dd29b1f09a455..7a8a56021b901022f0c9774e99bcd6ad827fcb51 100644 --- a/verifier/lib/idassertion.js +++ b/verifier/lib/idassertion.js @@ -48,6 +48,9 @@ const url = require("url"); const rsa = require("./rsa.js"); const logger = require("../../libs/logging.js").logger; +// configuration information to check the issuer +const config = require("../../libs/configuration.js"); + var Webfinger = (function() { // contains domain to template string @@ -309,6 +312,14 @@ IDAssertion.prototype = return; } + // check that the issuer is just US for now, no other issuer + // FIXME: this will need to change for certs + var expected_issuer = config.get('hostname') + ':' + config.get('port'); + if (payload.issuer != expected_issuer) { + onError("Issuer can only be ourselves for now, it should be: " + expected_issuer); + return; + } + // (if there was a certificate, we could verify it here) // but for now we will assume email-based lookup