Source/WebCore/ChangeLog

 12011-03-15 Alexey Proskuryakov <ap@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION (WebKit2): keygen element doesn't work
 6 https://bugs.webkit.org/show_bug.cgi?id=56402
 7 <rdar://problem/9006545>
 8
 9 Covered by existing regresison tests.
 10
 11 * English.lproj/Localizable.strings:
 12
 13 * WebCore.exp.in: Removed WebCoreKeyGenerator, which no longer exists. Added
 14 _wkSignedPublicKeyAndChallengeString, so that this WKSI function could be used in WebCore.
 15
 16 * platform/mac/SSLKeyGeneratorMac.mm: Removed.
 17 * platform/mac/WebCoreKeyGenerator.h: Removed.
 18 * platform/mac/WebCoreKeyGenerator.m: Removed.
 19 * platform/mac/WebCoreSystemInterface.h:
 20 * platform/mac/WebCoreSystemInterface.mm:
 21 * WebCore.xcodeproj/project.pbxproj:
 22 Renamed SSLKeyGeneratorMac.mm to .cpp, as it doesn't use any Objective C any more.
 23 Removed WebCoreKeyGenerator, as we no longer need an interface to WebKit.
 24
 25 * platform/LocalizationStrategy.h:
 26 * platform/LocalizedStrings.cpp:
 27 (WebCore::keygenMenuItem512):
 28 (WebCore::keygenMenuItem1024):
 29 (WebCore::keygenMenuItem2048):
 30 (WebCore::keygenKeychainItemName):
 31 * platform/LocalizedStrings.h:
 32 Added strings used by keygen element, now that the code using them is in WebCore.
 33
 34 * platform/mac/SSLKeyGeneratorMac.cpp: Copied from Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm.
 35 (WebCore::getSupportedKeySizes):
 36 (WebCore::signedPublicKeyAndChallengeString):
 37 Moved the code from WebKit. There is never any need to provide implementation at runtime,
 38 like old code was doing.
 39
 40 * platform/win/SSLKeyGeneratorWin.cpp: (WebCore::WebCore::getSupportedKeySizes):
 41 Added a FIXME about localization. Note that Safari for Windows doesn't support keygen.
 42
1432011-03-08 Levi Weintraub <leviw@chromium.org>
244
345 Reviewed by Ryosuke Niwa.
81165

Source/WebCore/WebCore.exp.in

105105.objc_class_name_DOMTreeWalker
106106.objc_class_name_DOMUIEvent
107107.objc_class_name_DOMWheelEvent
108 .objc_class_name_WebCoreKeyGenerator
109108.objc_class_name_WebCoreViewFactory
110109.objc_class_name_WebFontCache
111110.objc_class_name_WebScriptObject

@@_wkSetUpFontCache
13551354_wkSignalCFReadStreamEnd
13561355_wkSignalCFReadStreamError
13571356_wkSignalCFReadStreamHasBytes
 1357_wkSignedPublicKeyAndChallengeString
13581358
13591359#if ENABLE(DOM_STORAGE)
13601360__ZN7WebCore14StorageTracker17initializeTrackerERKN3WTF6StringE
81063

Source/WebCore/English.lproj/Localizable.strings

181181/* Undo action name */
182182"Justify (Undo action name)" = "Justify";
183183
184 /* name of keychain key generated by the KEYGEN tag */
 184/* Name of keychain key generated by the KEYGEN tag */
185185"Key from %@" = "Key from %@";
186186
 187/* Name of keychain key generated by the KEYGEN tag */
 188"Key from <hostname>" = "Key from <hostname>";
 189
187190/* Learn Spelling context menu item */
188191"Learn Spelling" = "Learn Spelling";
189192
81063

Source/WebCore/WebCore.xcodeproj/project.pbxproj

29762976 93F199B808245E59001E9ABC /* Scrollbar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7B2AF80450824100A8000F /* Scrollbar.h */; settings = {ATTRIBUTES = (Private, ); }; };
29772977 93F199BB08245E59001E9ABC /* WebCoreKeyboardUIMode.h in Headers */ = {isa = PBXBuildFile; fileRef = BE983D95052A2E0A00892D85 /* WebCoreKeyboardUIMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
29782978 93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A640F00533BB1F0085E777 /* BlockExceptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
2979  93F199C208245E59001E9ABC /* WebCoreKeyGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
29802979 93F199DE08245E59001E9ABC /* Position.h in Headers */ = {isa = PBXBuildFile; fileRef = BE91FC8B06133666005E3790 /* Position.h */; settings = {ATTRIBUTES = (Private, ); }; };
29812980 93F199E508245E59001E9ABC /* HTMLCanvasElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F6A3D60663BF04004D2919 /* HTMLCanvasElement.h */; };
29822981 93F199E708245E59001E9ABC /* ClipboardMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D90660B0665D937006B6F1A /* ClipboardMac.h */; settings = {ATTRIBUTES = (Private, ); }; };

29922991 93F19ABC08245E59001E9ABC /* XMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30902DE4476018635CA /* XMLDocumentParser.cpp */; };
29932992 93F19AD508245E59001E9ABC /* RenderTreeAsText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93955A4203D72932008635CE /* RenderTreeAsText.cpp */; };
29942993 93F19AE108245E59001E9ABC /* BlockExceptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65F80697054D9F86008BF776 /* BlockExceptions.mm */; };
2995  93F19AE508245E59001E9ABC /* WebCoreKeyGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */; };
2996  93F19AE608245E59001E9ABC /* SSLKeyGeneratorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */; };
 2994 93F19AE608245E59001E9ABC /* SSLKeyGeneratorMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.cpp */; };
29972995 93F19AF808245E59001E9ABC /* Position.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE91FC8C06133666005E3790 /* Position.cpp */; };
29982996 93F19AFD08245E59001E9ABC /* HTMLCanvasElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F6A3D50663BF04004D2919 /* HTMLCanvasElement.cpp */; };
29992997 93F19AFF08245E59001E9ABC /* ClipboardMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D90660C0665D937006B6F1A /* ClipboardMac.mm */; };

83198317 84A81F3C0FC7DFF000955300 /* SourceAlpha.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SourceAlpha.h; path = filters/SourceAlpha.h; sourceTree = "<group>"; };
83208318 84A81F3F0FC7E02700955300 /* SourceGraphic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SourceGraphic.cpp; path = filters/SourceGraphic.cpp; sourceTree = "<group>"; };
83218319 84A81F400FC7E02700955300 /* SourceGraphic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SourceGraphic.h; path = filters/SourceGraphic.h; sourceTree = "<group>"; };
8322  84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreKeyGenerator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
8323  84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebCoreKeyGenerator.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
8324  84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SSLKeyGeneratorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 8320 84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SSLKeyGeneratorMac.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
83258321 84B6B975120F13E500B8EFAF /* SVGPathSegListSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListSource.cpp; sourceTree = "<group>"; };
83268322 84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListSource.h; sourceTree = "<group>"; };
83278323 84C5B2F81216DC810088B53A /* SVGPathTraversalStateBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathTraversalStateBuilder.cpp; sourceTree = "<group>"; };

1406514061 93309E9F099EB78C0056E581 /* SharedTimerMac.mm */,
1406614062 0A4844980CA44CB200B7BD48 /* SoftLinking.h */,
1406714063 4B3043C80AE0371D00A82647 /* SoundMac.mm */,
14068  84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */,
 14064 84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.cpp */,
1406914065 93B2D8170F9920EE006AE6B2 /* SuddenTermination.mm */,
1407014066 6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */,
1407114067 BCE659E50EA92FB2007E4533 /* ThemeMac.h */,
1407214068 BCE659E80EA92FFA007E4533 /* ThemeMac.mm */,
1407314069 51DF6D7F0B92A18E00C2DC85 /* ThreadCheck.mm */,
14074  84B2B1F7056BEF3A00D2B771 /* WebCoreKeyGenerator.h */,
14075  84B2B1F8056BEF3A00D2B771 /* WebCoreKeyGenerator.m */,
1407614070 934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */,
1407714071 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */,
1407814072 DD05FE0B0B8BA3C6009ACDFE /* WebCoreObjCExtras.h */,

2252322517 93F199A808245E59001E9ABC /* WebCoreFrameView.h in Headers */,
2252422518 BC53D911114310CC000D817E /* WebCoreJSClientData.h in Headers */,
2252522519 93F199BB08245E59001E9ABC /* WebCoreKeyboardUIMode.h in Headers */,
22526  93F199C208245E59001E9ABC /* WebCoreKeyGenerator.h in Headers */,
2252722520 934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */,
2252822521 DD05FE0D0B8BA3C6009ACDFE /* WebCoreObjCExtras.h in Headers */,
2252922522 EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */,

2494124934 B5C1123B102B6C4600096578 /* SQLTransactionCoordinator.cpp in Sources */,
2494224935 B523CF091182675400EBB29C /* SQLTransactionSync.cpp in Sources */,
2494324936 1A2E6E590CC55213004A2062 /* SQLValue.cpp in Sources */,
24944  93F19AE608245E59001E9ABC /* SSLKeyGeneratorMac.mm in Sources */,
 24937 93F19AE608245E59001E9ABC /* SSLKeyGeneratorMac.cpp in Sources */,
2494524938 CEA3949C11D45CDA003094CF /* StaticHashSetNodeList.cpp in Sources */,
2494624939 BC7FA62E0D1F0EFF00DB22A9 /* StaticNodeList.cpp in Sources */,
2494724940 A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */,

2520425197 93309E1D099E64920056E581 /* visible_units.cpp in Sources */,
2520525198 93309E1F099E64920056E581 /* VisiblePosition.cpp in Sources */,
2520625199 A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */,
25207  93F19AE508245E59001E9ABC /* WebCoreKeyGenerator.m in Sources */,
2520825200 934D9BA50B8C116B007B42A9 /* WebCoreNSStringExtras.mm in Sources */,
2520925201 B50F5B810E96CD9900AD71A6 /* WebCoreObjCExtras.mm in Sources */,
2521025202 93EB169509F880B00091F8FF /* WebCoreSystemInterface.mm in Sources */,
81063

Source/WebCore/platform/LocalizationStrategy.h

@@public:
167167 virtual String allFilesText() = 0;
168168#endif
169169
 170#if PLATFORM(MAC)
 171 virtual String keygenMenuItem512() = 0;
 172 virtual String keygenMenuItem1024() = 0;
 173 virtual String keygenMenuItem2048() = 0;
 174 virtual String keygenKeychainItemName(const String& host) = 0;
 175#endif
 176
170177 virtual String imageTitle(const String& filename, const IntSize& size) = 0;
171178
172179 virtual String mediaElementLoadingStateText() = 0;
81063

Source/WebCore/platform/LocalizedStrings.cpp

@@String allFilesText()
569569}
570570#endif
571571
 572#if PLATFORM(MAC)
 573String keygenMenuItem512()
 574{
 575 return platformStrategies()->localizationStrategy()->keygenMenuItem512();
 576}
 577
 578String keygenMenuItem1024()
 579{
 580 return platformStrategies()->localizationStrategy()->keygenMenuItem1024();
 581}
 582
 583String keygenMenuItem2048()
 584{
 585 return platformStrategies()->localizationStrategy()->keygenMenuItem2048();
 586}
 587
 588String keygenKeychainItemName(const String& host)
 589{
 590 return platformStrategies()->localizationStrategy()->keygenKeychainItemName(host);
 591}
 592
 593#endif
 594
572595String imageTitle(const String& filename, const IntSize& size)
573596{
574597 return platformStrategies()->localizationStrategy()->imageTitle(filename, size);
81063

Source/WebCore/platform/LocalizedStrings.h

@@namespace WebCore {
163163 String allFilesText();
164164#endif
165165
 166#if PLATFORM(MAC)
 167 String keygenMenuItem512();
 168 String keygenMenuItem1024();
 169 String keygenMenuItem2048();
 170 String keygenKeychainItemName(const String& host);
 171#endif
 172
166173 String imageTitle(const String& filename, const IntSize& size);
167174
168175 String mediaElementLoadingStateText();
81063

Source/WebCore/platform/mac/SSLKeyGeneratorMac.cpp

 1/*
 2 * Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#import "config.h"
 27#import "SSLKeyGenerator.h"
 28
 29#import "KURL.h"
 30#import "WebCoreKeyGenerator.h"
 31
 32namespace WebCore {
 33
 34void getSupportedKeySizes(Vector<String>& supportedKeySizes)
 35{
 36 NSEnumerator *enumerator = [[[WebCoreKeyGenerator sharedGenerator] strengthMenuItemTitles] objectEnumerator];
 37 NSString *string;
 38 while ((string = [enumerator nextObject]) != nil)
 39 supportedKeySizes.append(string);
 40}
 41
 42String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const KURL& url)
 43{
 44 return [[WebCoreKeyGenerator sharedGenerator] signedPublicKeyAndChallengeStringWithStrengthIndex:keySizeIndex
 45 challenge:challengeString
 46 pageURL:url];
 47}
 48
 49}
81063

Source/WebCore/platform/mac/SSLKeyGeneratorMac.cpp

11/*
2  * Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
 2 * Copyright (C) 2003, 2005, 2008, 2011 Apple Inc. All rights reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
55 * modification, are permitted provided that the following conditions

1010 * notice, this list of conditions and the following disclaimer in the
1111 * documentation and/or other materials provided with the distribution.
1212 *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
2424 */
2525
26 #import "config.h"
27 #import "SSLKeyGenerator.h"
 26#include "config.h"
 27#include "SSLKeyGenerator.h"
2828
29 #import "KURL.h"
30 #import "WebCoreKeyGenerator.h"
 29#include "KURL.h"
 30#include "LocalizedStrings.h"
 31#include "WebCoreSystemInterface.h"
 32#include <wtf/RetainPtr.h>
3133
3234namespace WebCore {
3335
3436void getSupportedKeySizes(Vector<String>& supportedKeySizes)
35 {
36  NSEnumerator *enumerator = [[[WebCoreKeyGenerator sharedGenerator] strengthMenuItemTitles] objectEnumerator];
37  NSString *string;
38  while ((string = [enumerator nextObject]) != nil)
39  supportedKeySizes.append(string);
 37{
 38 ASSERT(supportedKeySizes.isEmpty());
 39 supportedKeySizes.append(keygenMenuItem2048());
 40 supportedKeySizes.append(keygenMenuItem1024());
 41 supportedKeySizes.append(keygenMenuItem512());
4042}
4143
4244String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const KURL& url)
4345{
44  return [[WebCoreKeyGenerator sharedGenerator] signedPublicKeyAndChallengeStringWithStrengthIndex:keySizeIndex
45  challenge:challengeString
46  pageURL:url];
 46 // This switch statement must always be synced with the UI strings returned by getSupportedKeySizes.
 47 UInt32 keySize;
 48 switch (keySizeIndex) {
 49 case 0:
 50 keySize = 2048;
 51 break;
 52 case 1:
 53 keySize = 1024;
 54 break;
 55 case 2:
 56 keySize = 512;
 57 break;
 58 default:
 59 ASSERT_NOT_REACHED();
 60 return String();
 61 }
 62
 63 RetainPtr<CFStringRef> challengeStringCF(AdoptCF, challengeString.createCFString());
 64 RetainPtr<CFStringRef> keyDescription(AdoptCF, keygenKeychainItemName(url.host()).createCFString());
 65 RetainPtr<CFStringRef> result(AdoptCF, wkSignedPublicKeyAndChallengeString(keySize, challengeStringCF.get(), keyDescription.get()));
 66
 67 return result.get();
4768}
4869
4970}
81063

Source/WebCore/platform/mac/SSLKeyGeneratorMac.mm

1 /*
2  * Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #import "config.h"
27 #import "SSLKeyGenerator.h"
28 
29 #import "KURL.h"
30 #import "WebCoreKeyGenerator.h"
31 
32 namespace WebCore {
33 
34 void getSupportedKeySizes(Vector<String>& supportedKeySizes)
35 {
36  NSEnumerator *enumerator = [[[WebCoreKeyGenerator sharedGenerator] strengthMenuItemTitles] objectEnumerator];
37  NSString *string;
38  while ((string = [enumerator nextObject]) != nil)
39  supportedKeySizes.append(string);
40 }
41 
42 String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String& challengeString, const KURL& url)
43 {
44  return [[WebCoreKeyGenerator sharedGenerator] signedPublicKeyAndChallengeStringWithStrengthIndex:keySizeIndex
45  challenge:challengeString
46  pageURL:url];
47 }
48 
49 }
81063

Source/WebCore/platform/mac/WebCoreKeyGenerator.h

1 /*
2  * Copyright (C) 2003 Apple Computer, Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 @interface WebCoreKeyGenerator : NSObject
27 
28 + (WebCoreKeyGenerator *)sharedGenerator;
29 - (NSArray *)strengthMenuItemTitles;
30 - (NSString *)signedPublicKeyAndChallengeStringWithStrengthIndex:(unsigned)index challenge:(NSString *)challenge pageURL:(NSURL *)pageURL;
31 
32 @end
81063

Source/WebCore/platform/mac/WebCoreKeyGenerator.m

1 /*
2  * Copyright (C) 2003 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #import "config.h"
27 #import "WebCoreKeyGenerator.h"
28 
29 #import <wtf/Assertions.h>
30 #import <wtf/UnusedParam.h>
31 
32 static WebCoreKeyGenerator *sharedGenerator;
33 
34 @implementation WebCoreKeyGenerator
35 
36 + (WebCoreKeyGenerator *)sharedGenerator
37 {
38  return sharedGenerator;
39 }
40 
41 - init
42 {
43  ASSERT(!sharedGenerator);
44  [super init];
45  sharedGenerator = [self retain];
46  return self;
47 }
48 
49 - (NSArray *)strengthMenuItemTitles
50 {
51  return nil;
52 }
53 
54 - (NSString *)signedPublicKeyAndChallengeStringWithStrengthIndex:(unsigned)unusedIndex challenge:(NSString *)unusedChallenge pageURL:(NSURL *)unusedPageURL
55 {
56  UNUSED_PARAM(unusedIndex);
57  UNUSED_PARAM(unusedChallenge);
58  UNUSED_PARAM(unusedPageURL);
59 
60  return nil;
61 }
62 
63 @end
81063

Source/WebCore/platform/mac/WebCoreSystemInterface.h

@@extern BOOL (*wkGetGlyphTransformedAdvan
117117extern void (*wkDrawMediaSliderTrack)(int themeStyle, CGContextRef context, CGRect rect, float timeLoaded, float currentTime,
118118 float duration, unsigned state);
119119extern void (*wkDrawMediaUIPart)(int part, int themeStyle, CGContextRef context, CGRect rect, unsigned state);
 120extern CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
120121extern NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
121122extern NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
122123extern NSString* (*wkGetMIMETypeForExtension)(NSString*);
81063

Source/WebCore/platform/mac/WebCoreSystemInterface.mm

@@void (*wkDrawMediaUIPart)(int part, int
4848void (*wkMeasureMediaUIPart)(int part, int themeStyle, CGRect *bounds, CGSize *naturalSize);
4949BOOL (*wkMediaControllerThemeAvailable)(int themeStyle);
5050NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
 51CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
5152NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
5253NSString* (*wkGetMIMETypeForExtension)(NSString*);
5354NSTimeInterval (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
81063

Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp

@@namespace WebCore {
3030
3131void WebCore::getSupportedKeySizes(Vector<String>& v)
3232{
 33 // FIXME: Strings should be localizable.
3334 v.append("High Grade");
3435 v.append("Medium Grade");
3536}
81063

Source/WebKit2/ChangeLog

 12011-03-15 Alexey Proskuryakov <ap@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION (WebKit2): keygen element doesn't work
 6 https://bugs.webkit.org/show_bug.cgi?id=56402
 7 <rdar://problem/9006545>
 8
 9 * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
 10 * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
 11 Added strings used by keygen.
 12
 13 * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: Initialize a WebCore pointer to
 14 a function used by keygen.
 15
1162011-03-15 Beth Dakin <bdakin@apple.com>
217
318 Reviewed by Simon Fraser.
81165

Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

@@String WebPlatformStrategies::allFilesTe
771771
772772#endif
773773
 774#if PLATFORM(MAC)
 775
 776String WebPlatformStrategies::keygenMenuItem512()
 777{
 778 return UI_STRING("512 (Low Grade)", "Menu item title for KEYGEN pop-up menu");
 779}
 780
 781String WebPlatformStrategies::keygenMenuItem1024()
 782{
 783 return UI_STRING("1024 (Medium Grade)", "Menu item title for KEYGEN pop-up menu");
 784}
 785
 786String WebPlatformStrategies::keygenMenuItem2048()
 787{
 788 return UI_STRING("2048 (High Grade)", "Menu item title for KEYGEN pop-up menu");
 789}
 790
 791String WebPlatformStrategies::keygenKeychainItemName(const WTF::String& host)
 792{
 793 return UI_STRING("Key from <hostname>", "Name of keychain key generated by the KEYGEN tag").replace("<hostname>", host);
 794}
 795
 796#endif
 797
774798String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
775799{
776800 // FIXME: This should format the numbers correctly. In Mac WebKit, we used +[NSNumberFormatter localizedStringFromNumber:numberStyle:].
81063

Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

@@private:
178178 virtual String uploadFileText();
179179 virtual String allFilesText();
180180#endif
 181#if PLATFORM(MAC)
 182 virtual String keygenMenuItem512();
 183 virtual String keygenMenuItem1024();
 184 virtual String keygenMenuItem2048();
 185 virtual String keygenKeychainItemName(const String& host);
 186#endif
181187 virtual String imageTitle(const String& filename, const WebCore::IntSize& size);
182188 virtual String mediaElementLoadingStateText();
183189 virtual String mediaElementLiveBroadcastStateText();
81063

Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm

@@void InitWebCoreSystemInterface(void)
5959 INIT(GetHTTPPipeliningPriority);
6060 INIT(GetMIMETypeForExtension);
6161 INIT(GetNSURLResponseLastModifiedDate);
 62 INIT(SignedPublicKeyAndChallengeString);
6263 INIT(GetPreferredExtensionForMIMEType);
6364 INIT(GetUserToBaseCTM);
6465 INIT(GetWheelEventDeltas);
81063

Source/WebKit/ChangeLog

 12011-03-15 Alexey Proskuryakov <ap@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION (WebKit2): keygen element doesn't work
 6 https://bugs.webkit.org/show_bug.cgi?id=56402
 7 <rdar://problem/9006545>
 8
 9 * WebKit.xcodeproj/project.pbxproj: Renamed WebKeyGenerator.m to use Objective C++.
 10
1112011-03-11 Anton D'Auria <adauria@apple.com>
212
313 Reviewed and landed by Brady Eidson.
81165

Source/WebKit/WebKit.xcodeproj/project.pbxproj

307307 939811130824BF01008DF038 /* WebHistory.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65DA2608052CC18700A97B31 /* WebHistory.mm */; };
308308 939811150824BF01008DF038 /* WebNSDataExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = BECD142A0565830A005BB09C /* WebNSDataExtras.m */; };
309309 939811160824BF01008DF038 /* WebNSEventExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = BE887C00056D3A6E009BB3E7 /* WebNSEventExtras.m */; };
310  939811170824BF01008DF038 /* WebKeyGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 84723BE4056D719E0044BFEA /* WebKeyGenerator.m */; };
 310 939811170824BF01008DF038 /* WebKeyGenerator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84723BE4056D719E0044BFEA /* WebKeyGenerator.mm */; };
311311 939811190824BF01008DF038 /* WebNSPrintOperationExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = EDD1A5C705C83987008E3150 /* WebNSPrintOperationExtras.m */; };
312312 9398111A0824BF01008DF038 /* WebResource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84311A1305EAAAF00088EDA4 /* WebResource.mm */; };
313313 9398111B0824BF01008DF038 /* WebDefaultEditingDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BE95BEE505FD0805006E1513 /* WebDefaultEditingDelegate.m */; };

597597 8467275C0367158500CA2ACA /* WebPluginController.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginController.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
598598 8467275D0367158500CA2ACA /* WebPluginController.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPluginController.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
599599 84723BE3056D719E0044BFEA /* WebKeyGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKeyGenerator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
600  84723BE4056D719E0044BFEA /* WebKeyGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKeyGenerator.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
 600 84723BE4056D719E0044BFEA /* WebKeyGenerator.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKeyGenerator.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
601601 848DFF840365FE6A00CA2ACA /* WebPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPlugin.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
602602 848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginContainer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
603603 848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginViewFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };

13251325 9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */,
13261326 9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */,
13271327 84723BE3056D719E0044BFEA /* WebKeyGenerator.h */,
1328  84723BE4056D719E0044BFEA /* WebKeyGenerator.m */,
 1328 84723BE4056D719E0044BFEA /* WebKeyGenerator.mm */,
13291329 1AA879B411CBE9BF003C664F /* WebPlatformStrategies.h */,
13301330 1AA879B511CBE9BF003C664F /* WebPlatformStrategies.mm */,
13311331 0A2D87FB107AF52B00CDDEE3 /* WebPluginHalterClient.h */,

19261926 1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */,
19271927 939810E40824BF01008DF038 /* WebJavaScriptTextInputPanel.m in Sources */,
19281928 37D1DCA91065928C0068F7EF /* WebJSPDFDoc.mm in Sources */,
1929  939811170824BF01008DF038 /* WebKeyGenerator.m in Sources */,
 1929 939811170824BF01008DF038 /* WebKeyGenerator.mm in Sources */,
19301930 939811030824BF01008DF038 /* WebKitErrors.m in Sources */,
19311931 939810C30824BF01008DF038 /* WebKitLogging.m in Sources */,
19321932 939810C40824BF01008DF038 /* WebKitNSStringExtras.mm in Sources */,
81063

Source/WebKit/mac/ChangeLog

 12011-03-15 Alexey Proskuryakov <ap@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION (WebKit2): keygen element doesn't work
 6 https://bugs.webkit.org/show_bug.cgi?id=56402
 7 <rdar://problem/9006545>
 8
 9 * WebCoreSupport/WebKeyGenerator.h:
 10 * WebCoreSupport/WebKeyGenerator.m: Removed.
 11 * WebCoreSupport/WebKeyGenerator.mm: Copied from Source/WebKit/mac/WebCoreSupport/WebKeyGenerator.m.
 12 (+[WebKeyGenerator sharedGenerator]):
 13 (toWebCertificateParseResult):
 14 WebCore no longer needs WebKeyGenerator. Safari still does need a part of it, so keeping
 15 this misnamed and misplaced code for now.
 16
 17 * WebCoreSupport/WebPlatformStrategies.h:
 18 * WebCoreSupport/WebPlatformStrategies.mm:
 19 (WebPlatformStrategies::keygenMenuItem512):
 20 (WebPlatformStrategies::keygenMenuItem1024):
 21 (WebPlatformStrategies::keygenMenuItem2048):
 22 (WebPlatformStrategies::keygenKeychainItemName):
 23 Added strings used by keygen.
 24
 25 * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Initialize a WebCore
 26 pointer to a function used by keygen.
 27
 28 * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]): WebKeyGenerator can be lazily
 29 initialized now.
 30
1312011-03-15 Beth Dakin <bdakin@apple.com>
232
333 Reviewed by Simon Fraser.
81165

Source/WebKit/mac/WebCoreSupport/WebKeyGenerator.h

11/*
2  * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
 2 * Copyright (C) 2005, 2011 Apple Computer, Inc. All rights reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
55 * modification, are permitted provided that the following conditions
66 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
712 *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14  * its contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
2724 */
2825
2926typedef enum {

@@typedef enum {
3431
3532#ifdef __OBJC__
3633
37 #import <WebCore/WebCoreKeyGenerator.h>
 34@interface WebKeyGenerator : NSObject
3835
39 @interface WebKeyGenerator : WebCoreKeyGenerator
40 {
41  NSArray *strengthMenuItemTitles;
42 }
43 + (void)createSharedGenerator;
 36+ (WebKeyGenerator *)sharedGenerator;
4437- (WebCertificateParseResult)addCertificatesToKeychainFromData:(NSData *)data;
 38
4539@end
4640
4741#endif
81063

Source/WebKit/mac/WebCoreSupport/WebKeyGenerator.m

1 /*
2  * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14  * its contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #import <WebKit/WebKeyGenerator.h>
30 
31 #import "WebLocalizableStringsInternal.h"
32 #import <WebKitSystemInterface.h>
33 #import <wtf/Assertions.h>
34 
35 @implementation WebKeyGenerator
36 
37 + (void)createSharedGenerator
38 {
39  if (![self sharedGenerator]) {
40  [[[self alloc] init] release];
41  }
42  ASSERT([[self sharedGenerator] isKindOfClass:self]);
43 }
44 
45 - (void)dealloc
46 {
47  [strengthMenuItemTitles release];
48  [super dealloc];
49 }
50 
51 - (NSArray *)strengthMenuItemTitles
52 {
53  if (!strengthMenuItemTitles) {
54  strengthMenuItemTitles = [[NSArray alloc] initWithObjects:
55  UI_STRING_INTERNAL("2048 (High Grade)", "Menu item title for KEYGEN pop-up menu"),
56  UI_STRING_INTERNAL("1024 (Medium Grade)", "Menu item title for KEYGEN pop-up menu"),
57  UI_STRING_INTERNAL("512 (Low Grade)", "Menu item title for KEYGEN pop-up menu"), nil];
58  }
59  return strengthMenuItemTitles;
60 }
61 
62 - (NSString *)signedPublicKeyAndChallengeStringWithStrengthIndex:(unsigned)index challenge:(NSString *)challenge pageURL:(NSURL *)pageURL
63 {
64  // This switch statement must always be synced with the UI strings returned by strengthMenuItemTitles.
65  UInt32 keySize;
66  switch (index) {
67  case 0:
68  keySize = 2048;
69  break;
70  case 1:
71  keySize = 1024;
72  break;
73  case 2:
74  keySize = 512;
75  break;
76  default:
77  return nil;
78  }
79 
80  NSString *keyDescription = [NSString stringWithFormat:UI_STRING_INTERNAL("Key from %@", "name of keychain key generated by the KEYGEN tag"), [pageURL host]];
81  return [(NSString *)WKSignedPublicKeyAndChallengeString(keySize, (CFStringRef)challenge, (CFStringRef)keyDescription) autorelease];
82 }
83 
84 static inline WebCertificateParseResult toWebCertificateParseResult(WKCertificateParseResult result)
85 {
86  switch (result) {
87  case WKCertificateParseResultSucceeded:
88  return WebCertificateParseResultSucceeded;
89  case WKCertificateParseResultFailed:
90  return WebCertificateParseResultFailed;
91  case WKCertificateParseResultPKCS7:
92  return WebCertificateParseResultPKCS7;
93  }
94 
95  ASSERT_NOT_REACHED();
96  return WebCertificateParseResultFailed;
97 }
98 
99 - (WebCertificateParseResult)addCertificatesToKeychainFromData:(NSData *)data
100 {
101  return toWebCertificateParseResult(WKAddCertificatesToKeychainFromData([data bytes], [data length]));
102 }
103 
104 @end
81063

Source/WebKit/mac/WebCoreSupport/WebKeyGenerator.mm

 1/*
 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 *
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
 14 * its contributors may be used to endorse or promote products derived
 15 * from this software without specific prior written permission.
 16 *
 17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 27 */
 28
 29#import <WebKit/WebKeyGenerator.h>
 30
 31#import "WebLocalizableStringsInternal.h"
 32#import <WebKitSystemInterface.h>
 33#import <wtf/Assertions.h>
 34
 35@implementation WebKeyGenerator
 36
 37+ (void)createSharedGenerator
 38{
 39 if (![self sharedGenerator]) {
 40 [[[self alloc] init] release];
 41 }
 42 ASSERT([[self sharedGenerator] isKindOfClass:self]);
 43}
 44
 45- (void)dealloc
 46{
 47 [strengthMenuItemTitles release];
 48 [super dealloc];
 49}
 50
 51- (NSArray *)strengthMenuItemTitles
 52{
 53 if (!strengthMenuItemTitles) {
 54 strengthMenuItemTitles = [[NSArray alloc] initWithObjects:
 55 UI_STRING_INTERNAL("2048 (High Grade)", "Menu item title for KEYGEN pop-up menu"),
 56 UI_STRING_INTERNAL("1024 (Medium Grade)", "Menu item title for KEYGEN pop-up menu"),
 57 UI_STRING_INTERNAL("512 (Low Grade)", "Menu item title for KEYGEN pop-up menu"), nil];
 58 }
 59 return strengthMenuItemTitles;
 60}
 61
 62- (NSString *)signedPublicKeyAndChallengeStringWithStrengthIndex:(unsigned)index challenge:(NSString *)challenge pageURL:(NSURL *)pageURL
 63{
 64 // This switch statement must always be synced with the UI strings returned by strengthMenuItemTitles.
 65 UInt32 keySize;
 66 switch (index) {
 67 case 0:
 68 keySize = 2048;
 69 break;
 70 case 1:
 71 keySize = 1024;
 72 break;
 73 case 2:
 74 keySize = 512;
 75 break;
 76 default:
 77 return nil;
 78 }
 79
 80 NSString *keyDescription = [NSString stringWithFormat:UI_STRING_INTERNAL("Key from %@", "name of keychain key generated by the KEYGEN tag"), [pageURL host]];
 81 return [(NSString *)WKSignedPublicKeyAndChallengeString(keySize, (CFStringRef)challenge, (CFStringRef)keyDescription) autorelease];
 82}
 83
 84static inline WebCertificateParseResult toWebCertificateParseResult(WKCertificateParseResult result)
 85{
 86 switch (result) {
 87 case WKCertificateParseResultSucceeded:
 88 return WebCertificateParseResultSucceeded;
 89 case WKCertificateParseResultFailed:
 90 return WebCertificateParseResultFailed;
 91 case WKCertificateParseResultPKCS7:
 92 return WebCertificateParseResultPKCS7;
 93 }
 94
 95 ASSERT_NOT_REACHED();
 96 return WebCertificateParseResultFailed;
 97}
 98
 99- (WebCertificateParseResult)addCertificatesToKeychainFromData:(NSData *)data
 100{
 101 return toWebCertificateParseResult(WKAddCertificatesToKeychainFromData([data bytes], [data length]));
 102}
 103
 104@end
81063

Source/WebKit/mac/WebCoreSupport/WebKeyGenerator.mm

11/*
2  * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
 2 * Copyright (C) 2005, 2011 Apple Computer, Inc. All rights reserved.
33 *
44 * Redistribution and use in source and binary forms, with or without
55 * modification, are permitted provided that the following conditions
66 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
712 *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14  * its contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
2724 */
2825
2926#import <WebKit/WebKeyGenerator.h>
3027
31 #import "WebLocalizableStringsInternal.h"
3228#import <WebKitSystemInterface.h>
3329#import <wtf/Assertions.h>
3430
3531@implementation WebKeyGenerator
3632
37 + (void)createSharedGenerator
 33+ (WebKeyGenerator *)sharedGenerator
3834{
39  if (![self sharedGenerator]) {
40  [[[self alloc] init] release];
41  }
42  ASSERT([[self sharedGenerator] isKindOfClass:self]);
43 }
44 
45 - (void)dealloc
46 {
47  [strengthMenuItemTitles release];
48  [super dealloc];
49 }
50 
51 - (NSArray *)strengthMenuItemTitles
52 {
53  if (!strengthMenuItemTitles) {
54  strengthMenuItemTitles = [[NSArray alloc] initWithObjects:
55  UI_STRING_INTERNAL("2048 (High Grade)", "Menu item title for KEYGEN pop-up menu"),
56  UI_STRING_INTERNAL("1024 (Medium Grade)", "Menu item title for KEYGEN pop-up menu"),
57  UI_STRING_INTERNAL("512 (Low Grade)", "Menu item title for KEYGEN pop-up menu"), nil];
58  }
59  return strengthMenuItemTitles;
60 }
61 
62 - (NSString *)signedPublicKeyAndChallengeStringWithStrengthIndex:(unsigned)index challenge:(NSString *)challenge pageURL:(NSURL *)pageURL
63 {
64  // This switch statement must always be synced with the UI strings returned by strengthMenuItemTitles.
65  UInt32 keySize;
66  switch (index) {
67  case 0:
68  keySize = 2048;
69  break;
70  case 1:
71  keySize = 1024;
72  break;
73  case 2:
74  keySize = 512;
75  break;
76  default:
77  return nil;
78  }
79 
80  NSString *keyDescription = [NSString stringWithFormat:UI_STRING_INTERNAL("Key from %@", "name of keychain key generated by the KEYGEN tag"), [pageURL host]];
81  return [(NSString *)WKSignedPublicKeyAndChallengeString(keySize, (CFStringRef)challenge, (CFStringRef)keyDescription) autorelease];
 35 static WebKeyGenerator *sharedGenerator = [[WebKeyGenerator alloc] init];
 36 return sharedGenerator;
8237}
8338
8439static inline WebCertificateParseResult toWebCertificateParseResult(WKCertificateParseResult result)
8540{
 41 // FIXME: WebKeyGenerator is not used in WebKit, and this code should be moved to Safari.
 42
8643 switch (result) {
8744 case WKCertificateParseResultSucceeded:
8845 return WebCertificateParseResultSucceeded;
81063

Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h

@@private:
153153 virtual WTF::String crashedPluginText();
154154 virtual WTF::String multipleFileUploadText(unsigned numberOfFiles);
155155 virtual WTF::String unknownFileSizeText();
 156 virtual WTF::String keygenMenuItem512();
 157 virtual WTF::String keygenMenuItem1024();
 158 virtual WTF::String keygenMenuItem2048();
 159 virtual WTF::String keygenKeychainItemName(const WTF::String& host);
156160 virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize& size);
157161 virtual WTF::String mediaElementLoadingStateText();
158162 virtual WTF::String mediaElementLiveBroadcastStateText();
81063

Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm

@@String WebPlatformStrategies::unknownFil
666666 return UI_STRING_INTERNAL("Unknown", "Unknown filesize FTP directory listing item");
667667}
668668
 669String WebPlatformStrategies::keygenMenuItem512()
 670{
 671 return UI_STRING_INTERNAL("512 (Low Grade)", "Menu item title for KEYGEN pop-up menu");
 672}
 673
 674String WebPlatformStrategies::keygenMenuItem1024()
 675{
 676 return UI_STRING_INTERNAL("1024 (Medium Grade)", "Menu item title for KEYGEN pop-up menu");
 677}
 678
 679String WebPlatformStrategies::keygenMenuItem2048()
 680{
 681 return UI_STRING_INTERNAL("2048 (High Grade)", "Menu item title for KEYGEN pop-up menu");
 682}
 683
 684String WebPlatformStrategies::keygenKeychainItemName(const WTF::String& host)
 685{
 686 return [NSString stringWithFormat:UI_STRING_INTERNAL("Key from %@", "Name of keychain key generated by the KEYGEN tag"), (NSString *)host];
 687}
 688
669689String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
670690{
671691#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
81063

Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm

@@void InitWebCoreSystemInterface(void)
6363 INIT(GetHTTPPipeliningPriority);
6464 INIT(GetMIMETypeForExtension);
6565 INIT(GetNSURLResponseLastModifiedDate);
 66 INIT(SignedPublicKeyAndChallengeString);
6667 INIT(GetPreferredExtensionForMIMEType);
6768 INIT(GetWheelEventDeltas);
6869 INIT(HitTestMediaUIPart);
81063

Source/WebKit/mac/WebView/WebFrameView.mm

@@- (id)initWithFrame:(NSRect)frame
308308 WebCore::notifyHistoryItemChanged = WKNotifyHistoryItemChanged;
309309
310310 [WebViewFactory createSharedFactory];
311  [WebKeyGenerator createSharedGenerator];
312311
313312// FIXME: Remove the NSAppKitVersionNumberWithDeferredWindowDisplaySupport check once
314313// once AppKit's Deferred Window Display support is available.
81063

LayoutTests/ChangeLog

 12011-03-15 Alexey Proskuryakov <ap@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 REGRESSION (WebKit2): keygen element doesn't work
 6 https://bugs.webkit.org/show_bug.cgi?id=56402
 7 <rdar://problem/9006545>
 8
 9 * platform/mac-wk2/Skipped:
 10 * platform/win-wk2/Skipped:
 11 Moved tests that were skipped becasue of keygen to win-wk2/Skipped.
 12
1132011-03-15 Anders Carlsson <andersca@apple.com>
214
315 Reviewed by Sam Weinig.
81166

LayoutTests/platform/mac-wk2/Skipped

@@http/tests/loading/cross-origin-XHR-will
18861886fast/dom/Window/window-resize-and-move-arguments.html
18871887fast/dom/Window/window-resize.html
18881888
1889 # WebKit2 needs keygen support
1890 fast/html/keygen.html
1891 fast/invalid/residual-style.html
1892 html5lib/runner.html
1893 
18941889# WebKitTestRunner needs to sanitize file urls in the output
18951890http/tests/misc/image-blocked-src-change.html
18961891http/tests/misc/image-blocked-src-no-change.html
81063

LayoutTests/platform/win-wk2/Skipped

@@fast/frames/iframe-plugin-load-remove-do
155155
156156# Crashes http://webkit.org/b/55780
157157platform/win/plugins/get-value-netscape-window.html
 158
 159# No keygen support
 160fast/html/keygen.html
 161fast/invalid/residual-style.html
 162html5lib/runner.html
81063