callback with an error if we don't get a valid RSA key (resolves #29)

This commit is contained in:
Alexander Corn 2015-12-05 00:24:52 -05:00
parent 01428e6007
commit 448b32b9c6

View File

@ -69,6 +69,11 @@ SteamCommunity.prototype.login = function(details, callback) {
callback(e);
return;
}
if(!json.publickey_mod || !json.publickey_exp) {
callback(new Error("Invalid RSA key received"));
return;
}
var key = new RSA();
key.setPublic(json.publickey_mod, json.publickey_exp);