WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
webkit-60232-keygen_pass_document.diff (text/plain), 18.10 KB, created by
Matt Mueller
on 2011-05-04 17:46:17 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Matt Mueller
Created:
2011-05-04 17:46:17 PDT
Size:
18.10 KB
patch
obsolete
>commit 833593db1e8d775302560fe341212f82851140ce >Author: Matt Mueller <mattm@chromium.org> >Date: Wed May 4 17:43:39 2011 -0700 > > Change signedPublicKeyAndChallengeString to pass the Document along so that we can associate the keygen request with a specific frame. > > For Chromium, move signedPublicKeyAndChallengeString from WebKitClient into WebFrameClient. > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0ad3ac7..be3f5db 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,39 @@ >+2011-05-04 Matt Mueller <mattm@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Change signedPublicKeyAndChallengeString to pass the Document along so >+ that we can associate the keygen request with a specific Frame. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=60232 >+ >+ * html/HTMLKeygenElement.cpp: >+ (WebCore::HTMLKeygenElement::appendFormData): >+ * platform/SSLKeyGenerator.h: >+ * platform/android/SSLKeyGeneratorAndroid.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/brew/SSLKeyGeneratorBrew.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/chromium/PlatformBridge.h: >+ * platform/chromium/SSLKeyGeneratorChromium.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/efl/TemporaryLinkStubs.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/gtk/TemporaryLinkStubs.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/haiku/TemporaryLinkStubs.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/mac/SSLKeyGeneratorMac.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/qt/TemporaryLinkStubsQt.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/win/SSLKeyGeneratorWin.cpp: >+ (WebCore::WebCore::signedPublicKeyAndChallengeString): >+ * platform/win/TemporaryLinkStubs.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ * platform/wx/SSLKeyGeneratorWx.cpp: >+ (WebCore::signedPublicKeyAndChallengeString): >+ > 2011-05-04 Alexis Menard <alexis.menard@openbossa.org> > > Unreviewed warning fix. >diff --git a/Source/WebCore/html/HTMLKeygenElement.cpp b/Source/WebCore/html/HTMLKeygenElement.cpp >index 29c9deb..a76b6e1 100644 >--- a/Source/WebCore/html/HTMLKeygenElement.cpp >+++ b/Source/WebCore/html/HTMLKeygenElement.cpp >@@ -106,7 +106,7 @@ bool HTMLKeygenElement::appendFormData(FormDataList& encoded_values, bool) > // Only RSA is supported at this time. > if (!m_keyType.isNull() && !equalIgnoringCase(m_keyType, "rsa")) > return false; >- String value = signedPublicKeyAndChallengeString(shadowSelect()->selectedIndex(), m_challenge, document()->baseURL()); >+ String value = signedPublicKeyAndChallengeString(shadowSelect()->selectedIndex(), m_challenge, document()); > if (value.isNull()) > return false; > encoded_values.appendData(name(), value.utf8()); >diff --git a/Source/WebCore/platform/SSLKeyGenerator.h b/Source/WebCore/platform/SSLKeyGenerator.h >index f81f0a5..5fed826 100644 >--- a/Source/WebCore/platform/SSLKeyGenerator.h >+++ b/Source/WebCore/platform/SSLKeyGenerator.h >@@ -31,7 +31,7 @@ > > namespace WebCore { > >- class KURL; >+ class Document; > > // Returns strings representing key sizes that may be used > // for the <keygen> tag. The first string is displayed as the default >@@ -41,7 +41,7 @@ namespace WebCore { > // This function handles the <keygen> tag in form elements. > // Returns a signed copy of the combined challenge string and public > // key (from a newly generated key pair). >- String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const KURL&); >+ String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const Document*); > > } // namespace WebCore > >diff --git a/Source/WebCore/platform/android/SSLKeyGeneratorAndroid.cpp b/Source/WebCore/platform/android/SSLKeyGeneratorAndroid.cpp >index 287d5c4..fd81d9a 100644 >--- a/Source/WebCore/platform/android/SSLKeyGeneratorAndroid.cpp >+++ b/Source/WebCore/platform/android/SSLKeyGeneratorAndroid.cpp >@@ -26,6 +26,7 @@ > #include "config.h" > #include "SSLKeyGenerator.h" > >+#include "Document.h" > #include "PlatformBridge.h" > > namespace WebCore { >@@ -35,9 +36,9 @@ void getSupportedKeySizes(Vector<String>& keys) > keys = PlatformBridge::getSupportedKeyStrengthList(); > } > >-String signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL& url) >+String signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const Document* document) > { >- return PlatformBridge::getSignedPublicKeyAndChallengeString(index, challenge, url); >+ return PlatformBridge::getSignedPublicKeyAndChallengeString(index, challenge, document->url()); > } > > } >diff --git a/Source/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp b/Source/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp >index dc1a148..aa51072 100644 >--- a/Source/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp >+++ b/Source/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp >@@ -29,7 +29,7 @@ void getSupportedKeySizes(Vector<String>& v) > notImplemented(); > } > >-String signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL& url) >+String signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const Document* document) > { > notImplemented(); > return String(); >diff --git a/Source/WebCore/platform/chromium/PlatformBridge.h b/Source/WebCore/platform/chromium/PlatformBridge.h >index 87ae1b3..80f4820 100644 >--- a/Source/WebCore/platform/chromium/PlatformBridge.h >+++ b/Source/WebCore/platform/chromium/PlatformBridge.h >@@ -181,7 +181,7 @@ public: > static bool allowScriptDespiteSettings(const KURL& documentURL); > > // Keygen ------------------------------------------------------------- >- static String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challenge, const KURL&); >+ static String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challenge, const Document*); > > // Language ----------------------------------------------------------- > static String computedDefaultLanguage(); >diff --git a/Source/WebCore/platform/chromium/SSLKeyGeneratorChromium.cpp b/Source/WebCore/platform/chromium/SSLKeyGeneratorChromium.cpp >index 6467764..e56c7b0 100644 >--- a/Source/WebCore/platform/chromium/SSLKeyGeneratorChromium.cpp >+++ b/Source/WebCore/platform/chromium/SSLKeyGeneratorChromium.cpp >@@ -49,11 +49,11 @@ void getSupportedKeySizes(Vector<String>& sizes) > > String signedPublicKeyAndChallengeString(unsigned keySizeIndex, > const String& challengeString, >- const KURL& url) >+ const Document* document) > { > return PlatformBridge::signedPublicKeyAndChallengeString(keySizeIndex, > challengeString, >- url); >+ document); > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/efl/TemporaryLinkStubs.cpp b/Source/WebCore/platform/efl/TemporaryLinkStubs.cpp >index be38565..c51ad29 100644 >--- a/Source/WebCore/platform/efl/TemporaryLinkStubs.cpp >+++ b/Source/WebCore/platform/efl/TemporaryLinkStubs.cpp >@@ -34,7 +34,6 @@ > #include "Editor.h" > #include "FTPDirectoryDocument.h" > #include "FrameView.h" >-#include "KURL.h" > #include "NotImplemented.h" > #include "PluginView.h" > #include "ScrollbarTheme.h" >@@ -51,7 +50,7 @@ void getSupportedKeySizes(Vector<String>&) > notImplemented(); > } > >-String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) >+String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const Document* document) > { > return String(); > } >@@ -72,4 +71,3 @@ void stopObservingCookieChanges() > } > > } >- >diff --git a/Source/WebCore/platform/gtk/TemporaryLinkStubs.cpp b/Source/WebCore/platform/gtk/TemporaryLinkStubs.cpp >index eee07ce..dbc26de 100644 >--- a/Source/WebCore/platform/gtk/TemporaryLinkStubs.cpp >+++ b/Source/WebCore/platform/gtk/TemporaryLinkStubs.cpp >@@ -45,7 +45,7 @@ using namespace WebCore; > > namespace WebCore { > void getSupportedKeySizes(Vector<String>&) { notImplemented(); } >-String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) { return String(); } >+String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const Document* document) { return String(); } > float userIdleTime() { notImplemented(); return FLT_MAX; } // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed > void setCookieStoragePrivateBrowsingEnabled(bool) { notImplemented(); } > void startObservingCookieChanges() { notImplemented(); } >diff --git a/Source/WebCore/platform/haiku/TemporaryLinkStubs.cpp b/Source/WebCore/platform/haiku/TemporaryLinkStubs.cpp >index 5ecb4f3..a1c60b5 100644 >--- a/Source/WebCore/platform/haiku/TemporaryLinkStubs.cpp >+++ b/Source/WebCore/platform/haiku/TemporaryLinkStubs.cpp >@@ -50,7 +50,7 @@ Vector<char> loadResourceIntoArray(const char*) > > namespace WebCore { > >-String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) >+String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const Document* document) > { > return String(); > } >@@ -93,4 +93,3 @@ void stopObservingCookieChanges() > } > > } // namespace WebCore >- >diff --git a/Source/WebCore/platform/mac/SSLKeyGeneratorMac.cpp b/Source/WebCore/platform/mac/SSLKeyGeneratorMac.cpp >index 0a1a4d8..4c3d3a3 100644 >--- a/Source/WebCore/platform/mac/SSLKeyGeneratorMac.cpp >+++ b/Source/WebCore/platform/mac/SSLKeyGeneratorMac.cpp >@@ -26,6 +26,7 @@ > #include "config.h" > #include "SSLKeyGenerator.h" > >+#include "Document.h" > #include "KURL.h" > #include "LocalizedStrings.h" > #include "WebCoreSystemInterface.h" >@@ -41,7 +42,7 @@ void getSupportedKeySizes(Vector<String>& supportedKeySizes) > supportedKeySizes.append(keygenMenuItem512()); > } > >-String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const KURL& url) >+String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const Document* document) > { > // This switch statement must always be synced with the UI strings returned by getSupportedKeySizes. > UInt32 keySize; >@@ -61,7 +62,7 @@ String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& ch > } > > RetainPtr<CFStringRef> challengeStringCF(AdoptCF, challengeString.createCFString()); >- RetainPtr<CFStringRef> keyDescription(AdoptCF, keygenKeychainItemName(url.host()).createCFString()); >+ RetainPtr<CFStringRef> keyDescription(AdoptCF, keygenKeychainItemName(document->url().host()).createCFString()); > RetainPtr<CFStringRef> result(AdoptCF, wkSignedPublicKeyAndChallengeString(keySize, challengeStringCF.get(), keyDescription.get())); > > return result.get(); >diff --git a/Source/WebCore/platform/qt/TemporaryLinkStubsQt.cpp b/Source/WebCore/platform/qt/TemporaryLinkStubsQt.cpp >index 12c54f2..9ec7cb6 100644 >--- a/Source/WebCore/platform/qt/TemporaryLinkStubsQt.cpp >+++ b/Source/WebCore/platform/qt/TemporaryLinkStubsQt.cpp >@@ -47,7 +47,6 @@ > #include "GraphicsContext.h" > #include "IconLoader.h" > #include "IntPoint.h" >-#include "KURL.h" > #include "Language.h" > #include "LocalizedStrings.h" > #include "Node.h" >@@ -109,7 +108,7 @@ void getSupportedKeySizes(Vector<String>&) > notImplemented(); > } > >-String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) >+String signedPublicKeyAndChallengeString(unsigned, const String&, const Document* document) > { > return String(); > } >diff --git a/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp b/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp >index b10961b..83fe20f 100644 >--- a/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp >+++ b/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp >@@ -35,7 +35,7 @@ void WebCore::getSupportedKeySizes(Vector<String>& v) > v.append("Medium Grade"); > } > >-String WebCore::signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL& url) >+String WebCore::signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const Document* document) > { > String keyString; > >diff --git a/Source/WebCore/platform/win/TemporaryLinkStubs.cpp b/Source/WebCore/platform/win/TemporaryLinkStubs.cpp >index 46a0714..d26eae2 100644 >--- a/Source/WebCore/platform/win/TemporaryLinkStubs.cpp >+++ b/Source/WebCore/platform/win/TemporaryLinkStubs.cpp >@@ -31,7 +31,7 @@ > namespace WebCore { > > // <keygen> >-String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) { notImplemented(); return String(); } >+String signedPublicKeyAndChallengeString(unsigned, const String&, const Document* document) { notImplemented(); return String(); } > void getSupportedKeySizes(Vector<String>&) { notImplemented(); } > > #if !USE(CFNETWORK) >diff --git a/Source/WebCore/platform/wx/SSLKeyGeneratorWx.cpp b/Source/WebCore/platform/wx/SSLKeyGeneratorWx.cpp >index 7d076e7..1e69fb4 100644 >--- a/Source/WebCore/platform/wx/SSLKeyGeneratorWx.cpp >+++ b/Source/WebCore/platform/wx/SSLKeyGeneratorWx.cpp >@@ -35,10 +35,9 @@ void getSupportedKeySizes(Vector<String>&) > notImplemented(); > } > >-String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) >+String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const Document* document) > { > return String(); > } > > } >- >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index 3ca088d..30896cc 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,19 @@ >+2011-05-04 Matt Mueller <mattm@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Move signedPublicKeyAndChallengeString from WebKitClient into >+ WebFrameClient, so that we can associate the keygen request with a >+ specific Frame. >+ >+ https://bugs.webkit.org/show_bug.cgi?id=60232 >+ >+ * public/WebFrameClient.h: >+ (WebKit::WebFrameClient::signedPublicKeyAndChallengeString): >+ * public/WebKitClient.h: >+ * src/PlatformBridge.cpp: >+ (WebCore::PlatformBridge::signedPublicKeyAndChallengeString): >+ > 2011-05-04 Nate Chapin <japhet@chromium.org> > > Reviewed by Mihai Parparita. >diff --git a/Source/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h >index fe848bd..ff4648c 100644 >--- a/Source/WebKit/chromium/public/WebFrameClient.h >+++ b/Source/WebKit/chromium/public/WebFrameClient.h >@@ -368,6 +368,17 @@ public: > unsigned long long newQuotaInBytes, > WebStorageQuotaCallbacks*) { } > >+ // Keygen -------------------------------------------------------------- >+ >+ // Handle the <keygen> tag for generating client certificates >+ // Returns a base64 encoded signed copy of a public key from a newly >+ // generated key pair and the supplied challenge string. keySizeindex >+ // specifies the strength of the key. >+ virtual WebString signedPublicKeyAndChallengeString( >+ unsigned keySizeIndex, >+ const WebString& challengeString, >+ const WebURL& url) { return WebString(); } >+ > protected: > ~WebFrameClient() { } > }; >diff --git a/Source/WebKit/chromium/public/WebKitClient.h b/Source/WebKit/chromium/public/WebKitClient.h >index 838e685..110a48d 100644 >--- a/Source/WebKit/chromium/public/WebKitClient.h >+++ b/Source/WebKit/chromium/public/WebKitClient.h >@@ -147,18 +147,6 @@ public: > virtual WebSerializedScriptValue injectIDBKeyIntoSerializedValue(const WebIDBKey& key, const WebSerializedScriptValue& value, const WebString& keyPath) { return WebSerializedScriptValue(); } > > >- // Keygen -------------------------------------------------------------- >- >- // Handle the <keygen> tag for generating client certificates >- // Returns a base64 encoded signed copy of a public key from a newly >- // generated key pair and the supplied challenge string. keySizeindex >- // specifies the strength of the key. >- virtual WebString signedPublicKeyAndChallengeString(unsigned keySizeIndex, >- const WebKit::WebString& challenge, >- const WebKit::WebURL& url) { return WebString(); } >- >- >- > // Memory -------------------------------------------------------------- > > // Returns the current space allocated for the pagefile, in MB. >diff --git a/Source/WebKit/chromium/src/PlatformBridge.cpp b/Source/WebKit/chromium/src/PlatformBridge.cpp >index 6dcc9d3..dea0c4f 100644 >--- a/Source/WebKit/chromium/src/PlatformBridge.cpp >+++ b/Source/WebKit/chromium/src/PlatformBridge.cpp >@@ -531,11 +531,19 @@ PassRefPtr<SerializedScriptValue> PlatformBridge::injectIDBKeyIntoSerializedValu > // Keygen --------------------------------------------------------------------- > > String PlatformBridge::signedPublicKeyAndChallengeString( >- unsigned keySizeIndex, const String& challenge, const KURL& url) >+ unsigned keySizeIndex, const String& challenge, const Document* document) > { >- return webKitClient()->signedPublicKeyAndChallengeString(keySizeIndex, >- WebString(challenge), >- WebURL(url)); >+ Frame* frame = document->frame(); >+ if (!frame) >+ return String(); >+ >+ WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame); >+ if (!webFrame->client()) >+ return String(); >+ >+ return webFrame->client()->signedPublicKeyAndChallengeString(keySizeIndex, >+ WebString(challenge), >+ WebURL(document->url())); > } > > // Language -------------------------------------------------------------------
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
abarth
:
review-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 60232
: 92350