Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4985)

Unified Diff: chrome/browser/resources/cryptotoken/enroller.js

Issue 847193003: Don't allow HTTP origins for the CryptoToken extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/cryptotoken/enroller.js
diff --git a/chrome/browser/resources/cryptotoken/enroller.js b/chrome/browser/resources/cryptotoken/enroller.js
index d8ef537faf8d704e4a21e7a914ec1779d0f944d3..ebc7f58acb105efb51a1c2ea2959706c92f188ab 100644
--- a/chrome/browser/resources/cryptotoken/enroller.js
+++ b/chrome/browser/resources/cryptotoken/enroller.js
@@ -50,6 +50,10 @@ function handleWebEnrollRequest(messageSender, request, sendResponse) {
sendErrorResponse({errorCode: ErrorCodes.BAD_REQUEST});
return null;
}
+ if (sender.origin.indexOf('http://') == 0 && !HTTP_ORIGINS_ALLOWED) {
+ sendErrorResponse({errorCode: ErrorCodes.BAD_REQUEST});
+ return null;
+ }
if (!isValidEnrollRequest(request, 'enrollChallenges', 'signData')) {
sendErrorResponse({errorCode: ErrorCodes.BAD_REQUEST});
@@ -124,6 +128,10 @@ function handleU2fEnrollRequest(messageSender, request, sendResponse) {
sendErrorResponse({errorCode: ErrorCodes.BAD_REQUEST});
return null;
}
+ if (sender.origin.indexOf('http://') == 0 && !HTTP_ORIGINS_ALLOWED) {
+ sendErrorResponse({errorCode: ErrorCodes.BAD_REQUEST});
+ return null;
+ }
if (!isValidEnrollRequest(request, 'registerRequests', 'signRequests',
'registeredKeys')) {
« no previous file with comments | « chrome/browser/resources/cryptotoken/cryptotokenbackground.js ('k') | chrome/browser/resources/cryptotoken/signer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698