diff --git a/server/camlistored/ui/server_connection.js b/server/camlistored/ui/server_connection.js index 02b1f632b..f67ac34bc 100644 --- a/server/camlistored/ui/server_connection.js +++ b/server/camlistored/ui/server_connection.js @@ -362,27 +362,24 @@ function(clearObj, success, opt_fail) { }; /** - * @param {Object} sObj Signed object. + * @param {Object} signed Signed JSON blob (string) to verify. * @param {Function} success Success callback. * @param {?Function} opt_fail Optional fail callback. * @private */ camlistore.ServerConnection.prototype.verify_ = -function(sObj, success, opt_fail) { +function(signed, success, opt_fail) { var sigConf = this.config_.signing; if (!sigConf || !sigConf.publicKeyBlobRef) { this.safeFail_(opt_fail)("Missing Camli.config.signing.publicKeyBlobRef"); return; } - - var clearText = JSON.stringify(sObj); - this.sendXhr_( sigConf.verifyHandler, goog.bind(this.handlePost_, this, success, this.safeFail_(opt_fail)), "POST", - "sjson=" + encodeURIComponent(clearText), + "sjson=" + encodeURIComponent(signed), {"Content-Type": "application/x-www-form-urlencoded"} ); }; diff --git a/server/camlistored/ui/sigdebug.js b/server/camlistored/ui/sigdebug.js index 10750e2e8..7b7d743d5 100644 --- a/server/camlistored/ui/sigdebug.js +++ b/server/camlistored/ui/sigdebug.js @@ -175,8 +175,7 @@ camlistore.DebugPage.prototype.doVerify_ = function() { return; } var signedta = goog.dom.getElement("signedjson"); - var sObj = JSON.parse(signedta.value); - this.connection_.verify_(sObj, + this.connection_.verify_(signedta.value, function(response) { var text = "
" + response + ""; goog.dom.getElement("verifyinfo").innerHTML = text;