Changeset 224023 in webkit
- Timestamp:
- Oct 26, 2017 10:18:20 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r224019 r224023 1 2017-10-26 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r223908. 4 5 Causes LayoutTest crashes with newer SDKs. 6 7 Reverted changeset: 8 9 "Adopt new secure coding APIs" 10 https://bugs.webkit.org/show_bug.cgi?id=178484 11 https://trac.webkit.org/changeset/223908 12 1 13 2017-10-25 Brent Fulgham <bfulgham@apple.com> 2 14 -
trunk/Source/WebCore/PAL/ChangeLog
r223929 r224023 1 2017-10-26 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r223908. 4 5 Causes LayoutTest crashes with newer SDKs. 6 7 Reverted changeset: 8 9 "Adopt new secure coding APIs" 10 https://bugs.webkit.org/show_bug.cgi?id=178484 11 https://trac.webkit.org/changeset/223908 12 1 13 2017-10-24 Eric Carlson <eric.carlson@apple.com> 2 14 -
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
r223908 r224023 109 109 1C4876D91F8D7F4E00CCEEBD /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4876D71F8D7F4E00CCEEBD /* Logging.h */; }; 110 110 1C4876E01F8D837500CCEEBD /* LoggingCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C4876DF1F8D837500CCEEBD /* LoggingCocoa.mm */; }; 111 7A1656441F97B2B900BA3CE4 /* NSKeyedArchiverSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */; };112 111 A10265871F56746100B4C844 /* FoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265861F56746100B4C844 /* FoundationSPI.h */; }; 113 112 A10265891F56747A00B4C844 /* HIToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265881F56747A00B4C844 /* HIToolboxSPI.h */; }; … … 251 250 1C67CEA11E32EDA800F80F2E /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; }; 252 251 1C67CEA21E32EE2600F80F2E /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; }; 253 7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSKeyedArchiverSPI.h; sourceTree = "<group>"; };254 252 A10265861F56746100B4C844 /* FoundationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoundationSPI.h; sourceTree = "<group>"; }; 255 253 A10265881F56747A00B4C844 /* HIToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HIToolboxSPI.h; sourceTree = "<group>"; }; … … 365 363 0C2DA1321F3BEB4900DBC317 /* NSExtensionSPI.h */, 366 364 0C2DA1331F3BEB4900DBC317 /* NSFileManagerSPI.h */, 367 7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */,368 365 0C2DA1341F3BEB4900DBC317 /* NSStringSPI.h */, 369 366 0C2DA1351F3BEB4900DBC317 /* NSTouchBarSPI.h */, … … 654 651 A10826FE1F58A433004772AC /* NSGraphicsSPI.h in Headers */, 655 652 0C7785911F45130F00F4EBB6 /* NSImmediateActionGestureRecognizerSPI.h in Headers */, 656 7A1656441F97B2B900BA3CE4 /* NSKeyedArchiverSPI.h in Headers */,657 653 0C7785921F45130F00F4EBB6 /* NSMenuSPI.h in Headers */, 658 654 0C7785931F45130F00F4EBB6 /* NSPasteboardSPI.h in Headers */, -
trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm
r223908 r224023 53 53 #import "markup.h" 54 54 #import <pal/spi/cocoa/NSAttributedStringSPI.h> 55 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>56 55 #import <wtf/BlockObjCExceptions.h> 57 56 … … 143 142 return nullptr; 144 143 145 return SharedBuffer::create( securelyArchivedDataWithRootObject(attributedString));144 return SharedBuffer::create([NSKeyedArchiver archivedDataWithRootObject:attributedString]); 146 145 } 147 146 -
trunk/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm
r223908 r224023 27 27 */ 28 28 29 #import "config.h" 30 #import "LegacyWebArchive.h" 31 32 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h> 29 #include "config.h" 30 #include "LegacyWebArchive.h" 33 31 34 32 namespace WebCore { … … 45 43 46 44 NSURLResponse *response = nil; 47 #if USE(NEW_ARCHIVER_API) 48 auto unarchiver = secureUnarchiverFromData((NSData *)responseData); 45 NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData]; 46 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS) 47 // Because of <rdar://problem/34063313> we can't use this for decoding in older OS's. 48 [unarchiver setRequiresSecureCoding:YES]; 49 49 @try { 50 50 response = [unarchiver decodeObjectOfClass:[NSURLResponse class] forKey:LegacyWebArchiveResourceResponseKey]; 51 51 #else 52 // Because of <rdar://problem/34063313> we can't use secure coding for decoding in older OS's.53 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData]);54 52 @try { 55 53 id responseObject = [unarchiver decodeObjectForKey:LegacyWebArchiveResourceResponseKey]; … … 62 60 response = nil; 63 61 } 64 62 [unarchiver release]; 63 65 64 return ResourceResponse(response); 66 65 } … … 75 74 CFMutableDataRef responseData = CFDataCreateMutable(0, 0); 76 75 77 auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:(NSMutableData *)responseData]);78 #if USE(NEW_ARCHIVER_API)76 NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:(NSMutableData *)responseData]; 77 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS) 79 78 // Because of <rdar://problem/34063313> we can't use this for encoding in older OS's. 80 79 [archiver setRequiresSecureCoding:YES]; … … 82 81 [archiver encodeObject:nsResponse forKey:LegacyWebArchiveResourceResponseKey]; 83 82 [archiver finishEncoding]; 84 83 [archiver release]; 84 85 85 return adoptCF(responseData); 86 86 } -
trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm
r223908 r224023 1 1 /* 2 * Copyright (C) 2013 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 37 37 #import <UIKit/UIImage.h> 38 38 #import <UIKit/UIPasteboard.h> 39 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>40 39 #import <pal/spi/ios/UIKitSPI.h> 41 40 #import <wtf/ListHashSet.h> … … 266 265 267 266 if (content.dataInAttributedStringFormat) { 268 NSAttributedString *attributedString = securelyUnarchiveObjectOfClassFromData([NSAttributedString class], content.dataInAttributedStringFormat->createNSData().get());267 NSAttributedString *attributedString = [NSKeyedUnarchiver unarchiveObjectWithData:content.dataInAttributedStringFormat->createNSData().get()]; 269 268 if (attributedString) 270 269 [representationsToRegister addRepresentingObject:attributedString]; … … 381 380 continue; 382 381 383 NSDictionary *teamDataObject = securelyUnarchiveObjectOfClassFromData([NSDictionary class], provider.teamData);384 if (!teamDataObject )385 continue; 386 387 id originInTeamData = [ teamDataObject objectForKey:@(originKeyForTeamData)];382 id teamDataObject = [NSKeyedUnarchiver unarchiveObjectWithData:provider.teamData]; 383 if (!teamDataObject || ![teamDataObject isKindOfClass:[NSDictionary class]]) 384 continue; 385 386 id originInTeamData = [(NSDictionary *)teamDataObject objectForKey:@(originKeyForTeamData)]; 388 387 if (![originInTeamData isKindOfClass:[NSString class]]) 389 388 continue; … … 446 445 for (auto& type : data.orderedTypes) 447 446 [typesAsNSArray addObject:type]; 448 [representationsToRegister setTeamData:securelyArchivedDataWithRootObject(@{ @(originKeyForTeamData) : data.origin, @(customTypesKeyForTeamData) : typesAsNSArray })]; 447 [representationsToRegister setTeamData:[NSKeyedArchiver archivedDataWithRootObject:@{ 448 @(originKeyForTeamData) : data.origin, @(customTypesKeyForTeamData) : typesAsNSArray }]]; 449 449 [representationsToRegister addData:serializedSharedBuffer.get() forType:@(PasteboardCustomData::cocoaType())]; 450 450 } -
trunk/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm
r223908 r224023 31 31 #import <CFNetwork/CFNetwork.h> 32 32 #import <pal/spi/cf/CFNetworkSPI.h> 33 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>34 33 #import <wtf/NeverDestroyed.h> 35 34 #import <wtf/RetainPtr.h> … … 42 41 static CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseData) 43 42 { 43 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData]); 44 44 NSURLResponse *response; 45 #if USE(NEW_ARCHIVER_API) 46 auto unarchiver = secureUnarchiverFromData((NSData *)responseData); 45 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS) 46 // Because of <rdar://problem/34063313> we can't use this for decoding in older OS's. 47 [unarchiver setRequiresSecureCoding:YES]; 47 48 @try { 48 49 response = [unarchiver decodeObjectOfClass:[NSURLResponse class] forKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m 49 50 #else 50 // Because of <rdar://problem/34063313> we can't use secure coding for decoding in older OS's.51 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData]);52 51 @try { 53 52 response = [unarchiver decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m -
trunk/Source/WebKit/ChangeLog
r224018 r224023 1 2017-10-26 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r223908. 4 5 Causes LayoutTest crashes with newer SDKs. 6 7 Reverted changeset: 8 9 "Adopt new secure coding APIs" 10 https://bugs.webkit.org/show_bug.cgi?id=178484 11 https://trac.webkit.org/changeset/223908 12 1 13 2017-10-26 Christopher Reid <chris.reid@sony.com> 2 14 -
trunk/Source/WebKit/Platform/ios/AccessibilityIOS.mm
r223908 r224023 26 26 #import "config.h" 27 27 #import "AccessibilityIOS.h" 28 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>29 28 30 29 #if PLATFORM(IOS) … … 36 35 if (!uuid) 37 36 return nil; 38 return securelyArchivedDataWithRootObject(@{ @"ax-pid" : @(getpid()), @"ax-uuid" : [uuid UUIDString], @"ax-register" : @YES });37 return [NSKeyedArchiver archivedDataWithRootObject:@{ @"ax-pid" : @(getpid()), @"ax-uuid" : [uuid UUIDString], @"ax-register" : @YES }]; 39 38 } 40 39 -
trunk/Source/WebKit/Shared/Cocoa/DataDetectionResult.mm
r223908 r224023 1 1 /* 2 * Copyright (C) 2014 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 #import "WebCoreArgumentCoders.h" 31 31 #import <pal/spi/cocoa/DataDetectorsCoreSPI.h> 32 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>33 32 #import <wtf/SoftLinking.h> 34 33 … … 43 42 { 44 43 RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]); 45 auto archiver = secureArchiverFromMutableData(data.get()); 44 RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 45 [archiver setRequiresSecureCoding:YES]; 46 46 [archiver encodeObject:results.get() forKey:@"dataDetectorResults"]; 47 47 [archiver finishEncoding]; … … 55 55 if (!IPC::decode(decoder, data)) 56 56 return false; 57 58 auto unarchiver = secureUnarchiverFromData((NSData *)data.get()); 57 58 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]); 59 [unarchiver setRequiresSecureCoding:YES]; 59 60 @try { 60 61 result.results = [unarchiver decodeObjectOfClasses:[NSSet setWithArray:@[ [NSArray class], getDDScannerResultClass()] ] forKey:@"dataDetectorResults"]; -
trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
r223908 r224023 1 1 /* 2 * Copyright (C) 2016 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #import "DataReference.h" 32 32 #import <WebCore/PaymentAuthorizationStatus.h> 33 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>34 33 #import <pal/spi/cocoa/PassKitSPI.h> 35 34 #import <wtf/SoftLinking.h> … … 53 52 { 54 53 auto data = adoptNS([[NSMutableData alloc] init]); 55 auto archiver = secureArchiverFromMutableData(data.get()); 54 auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 55 56 [archiver setRequiresSecureCoding:YES]; 56 57 57 58 [archiver encodeObject:payment.pkPayment() forKey:NSKeyedArchiveRootObjectKey]; … … 68 69 69 70 auto data = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]); 70 auto unarchiver = secureUnarchiverFromData(data.get()); 71 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:data.get()]); 72 [unarchiver setRequiresSecureCoding:YES]; 71 73 @try { 72 74 PKPayment *pkPayment = [unarchiver decodeObjectOfClass:getPKPaymentClass() forKey:NSKeyedArchiveRootObjectKey]; … … 105 107 { 106 108 auto data = adoptNS([[NSMutableData alloc] init]); 107 auto archiver = secureArchiverFromMutableData(data.get()); 109 auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 110 111 [archiver setRequiresSecureCoding:YES]; 108 112 109 113 [archiver encodeObject:paymentContact.pkContact() forKey:NSKeyedArchiveRootObjectKey]; … … 120 124 121 125 auto data = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]); 122 auto unarchiver = secureUnarchiverFromData(data.get()); 126 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:data.get()]); 127 [unarchiver setRequiresSecureCoding:YES]; 123 128 @try { 124 129 PKContact *pkContact = [unarchiver decodeObjectOfClass:getPKContactClass() forKey:NSKeyedArchiveRootObjectKey]; … … 163 168 { 164 169 auto data = adoptNS([[NSMutableData alloc] init]); 165 auto archiver = secureArchiverFromMutableData(data.get()); 170 auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 171 172 [archiver setRequiresSecureCoding:YES]; 166 173 167 174 [archiver encodeObject:paymentMerchantSession.pkPaymentMerchantSession() forKey:NSKeyedArchiveRootObjectKey]; … … 178 185 179 186 auto data = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]); 180 auto unarchiver = secureUnarchiverFromData(data.get()); 187 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:data.get()]); 188 [unarchiver setRequiresSecureCoding:YES]; 181 189 @try { 182 190 PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:getPKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey]; … … 188 196 189 197 [unarchiver finishDecoding]; 198 190 199 return true; 191 200 } … … 194 203 { 195 204 auto data = adoptNS([[NSMutableData alloc] init]); 196 auto archiver = secureArchiverFromMutableData(data.get()); 205 auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 206 207 [archiver setRequiresSecureCoding:YES]; 197 208 198 209 [archiver encodeObject:paymentMethod.pkPaymentMethod() forKey:NSKeyedArchiveRootObjectKey]; … … 209 220 210 221 auto data = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]); 211 auto unarchiver = secureUnarchiverFromData(data.get()); 222 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:data.get()]); 223 [unarchiver setRequiresSecureCoding:YES]; 212 224 @try { 213 225 PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:getPKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey]; -
trunk/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm
r223908 r224023 1 1 /* 2 * Copyright (C) 2014 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 #import "WebCoreArgumentCoders.h" 31 31 #import <pal/spi/cocoa/DataDetectorsCoreSPI.h> 32 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>33 32 #import <wtf/SoftLinking.h> 34 33 … … 75 74 encoder << dataDetectorIdentifier; 76 75 RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]); 77 auto archiver = secureArchiverFromMutableData(data.get()); 76 RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 77 [archiver setRequiresSecureCoding:YES]; 78 78 [archiver encodeObject:dataDetectorResults.get() forKey:@"dataDetectorResults"]; 79 79 [archiver finishEncoding]; … … 169 169 return false; 170 170 171 auto unarchiver = secureUnarchiverFromData((NSData *)data.get()); 171 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]); 172 [unarchiver setRequiresSecureCoding:YES]; 172 173 @try { 173 174 result.dataDetectorResults = [unarchiver decodeObjectOfClasses:[NSSet setWithArray:@[ [NSArray class], getDDScannerResultClass()] ] forKey:@"dataDetectorResults"]; -
trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm
r223908 r224023 1 1 /* 2 * Copyright (C) 2010 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2013 Company 100 Inc. All rights reserved. 4 4 * … … 39 39 #import <WebCore/ResourceRequest.h> 40 40 #import <pal/spi/cf/CFNetworkSPI.h> 41 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>42 41 43 42 #if USE(CFURLCONNECTION) … … 474 473 void ArgumentCoder<ProtectionSpace>::encodePlatformData(Encoder& encoder, const ProtectionSpace& space) 475 474 { 476 auto data = adoptNS([[NSMutableData alloc] init]); 477 auto archiver = secureArchiverFromMutableData(data.get()); 475 RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]); 476 RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 477 [archiver setRequiresSecureCoding:YES]; 478 478 [archiver encodeObject:space.nsSpace() forKey:@"protectionSpace"]; 479 479 [archiver finishEncoding]; … … 487 487 return false; 488 488 489 auto unarchiver = secureUnarchiverFromData((NSData *)data.get()); 489 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]); 490 [unarchiver setRequiresSecureCoding:YES]; 490 491 @try { 491 492 if (RetainPtr<NSURLProtectionSpace> nsSpace = [unarchiver decodeObjectOfClass:[NSURLProtectionSpace class] forKey:@"protectionSpace"]) … … 519 520 520 521 encoder << false; 521 auto data = adoptNS([[NSMutableData alloc] init]); 522 auto archiver = secureArchiverFromMutableData(data.get()); 522 RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]); 523 RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 524 [archiver setRequiresSecureCoding:YES]; 523 525 [archiver encodeObject:nsCredential forKey:@"credential"]; 524 526 [archiver finishEncoding]; … … 559 561 return false; 560 562 561 auto unarchiver = secureUnarchiverFromData((NSData *)data.get()); 563 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]); 564 [unarchiver setRequiresSecureCoding:YES]; 562 565 @try { 563 566 if (RetainPtr<NSURLCredential> nsCredential = [unarchiver decodeObjectOfClass:[NSURLCredential class] forKey:@"credential"]) … … 620 623 void ArgumentCoder<ContentFilterUnblockHandler>::encode(Encoder& encoder, const ContentFilterUnblockHandler& contentFilterUnblockHandler) 621 624 { 622 auto data = adoptNS([[NSMutableData alloc] init]); 623 auto archiver = secureArchiverFromMutableData(data.get()); 625 RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]); 626 RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 627 [archiver setRequiresSecureCoding:YES]; 624 628 contentFilterUnblockHandler.encode(archiver.get()); 625 629 [archiver finishEncoding]; … … 633 637 return false; 634 638 635 auto unarchiver = secureUnarchiverFromData((NSData *)data.get()); 639 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]); 640 [unarchiver setRequiresSecureCoding:YES]; 636 641 if (!ContentFilterUnblockHandler::decode(unarchiver.get(), contentFilterUnblockHandler)) 637 642 return false; … … 652 657 void ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData(Encoder& encoder, const MediaPlaybackTargetContext& target) 653 658 { 654 auto data = adoptNS([[NSMutableData alloc] init]); 655 auto archiver = secureArchiverFromMutableData(data.get()); 659 RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]); 660 RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 661 [archiver setRequiresSecureCoding:YES]; 656 662 657 663 if ([getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)]) … … 672 678 return false; 673 679 674 auto unarchiver = secureUnarchiverFromData((NSData *)data.get()); 680 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]); 681 [unarchiver setRequiresSecureCoding:YES]; 675 682 676 683 AVOutputContext *context = nil; -
trunk/Source/WebKit/Shared/mac/WebHitTestResultData.mm
r223908 r224023 1 1 /* 2 * Copyright (C) 2015 -2017Apple Inc. All rights reserved.2 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 #import "WebCoreArgumentCoders.h" 35 35 #import <WebCore/TextIndicator.h> 36 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>37 36 #import <pal/spi/mac/DataDetectorsSPI.h> 38 37 … … 46 45 return; 47 46 48 auto data = adoptNS([[NSMutableData alloc] init]); 49 auto archiver = secureArchiverFromMutableData(data.get()); 47 RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]); 48 RetainPtr<NSKeyedArchiver> archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 49 [archiver setRequiresSecureCoding:YES]; 50 50 [archiver encodeObject:detectedDataActionContext.get() forKey:@"actionContext"]; 51 51 [archiver finishEncoding]; … … 76 76 return false; 77 77 78 auto unarchiver = secureUnarchiverFromData((NSData *)data.get()); 78 RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]); 79 [unarchiver setRequiresSecureCoding:YES]; 79 80 @try { 80 81 hitTestResultData.detectedDataActionContext = [unarchiver decodeObjectOfClass:getDDActionContextClass() forKey:@"actionContext"]; -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
r223908 r224023 49 49 #import <WebCore/PluginData.h> 50 50 #import <pal/spi/cf/CFNetworkSPI.h> 51 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>52 51 #import <wtf/RetainPtr.h> 53 52 … … 215 214 216 215 auto data = adoptNS([[NSMutableData alloc] init]); 217 auto keyedArchiver = secureArchiverFromMutableData(data.get()); 216 auto keyedArchiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 217 [keyedArchiver setRequiresSecureCoding:YES]; 218 218 219 219 @try { … … 237 237 238 238 auto data = adoptNS([[NSMutableData alloc] init]); 239 auto keyedArchiver = secureArchiverFromMutableData(data.get()); 239 auto keyedArchiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 240 [keyedArchiver setRequiresSecureCoding:YES]; 240 241 241 242 @try { -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r223908 r224023 103 103 #import <WebCore/ViewportArguments.h> 104 104 #import <WebCore/WritingMode.h> 105 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>106 105 #import <pal/spi/mac/NSTextFinderSPI.h> 107 106 #import <wtf/BlockPtr.h> … … 4527 4526 if (API::Data* data = static_cast<API::Data*>(userData)) { 4528 4527 auto nsData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(data->bytes())) length:data->size() freeWhenDone:NO]); 4529 auto unarchiver = secureUnarchiverFromData(nsData.get()); 4528 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:nsData.get()]); 4529 [unarchiver setRequiresSecureCoding:YES]; 4530 4530 @try { 4531 4531 userObject = [unarchiver decodeObjectOfClass:[NSObject class] forKey:@"userObject"]; -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r223908 r224023 50 50 #import <WebCore/SharedBuffer.h> 51 51 #import <pal/spi/cf/CFNetworkSPI.h> 52 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>53 52 #import <sys/param.h> 54 53 … … 217 216 if (m_bundleParameters) { 218 217 auto data = adoptNS([[NSMutableData alloc] init]); 219 auto keyedArchiver = secureArchiverFromMutableData(data.get()); 218 auto keyedArchiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 219 220 [keyedArchiver setRequiresSecureCoding:YES]; 220 221 221 222 @try { -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r223908 r224023 56 56 #import <WebCore/TextIndicator.h> 57 57 #import <WebCore/ValidationBubble.h> 58 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>59 58 #import <wtf/BlockPtr.h> 60 59 … … 549 548 if (API::Data* data = static_cast<API::Data*>(userData)) { 550 549 auto nsData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(data->bytes())) length:data->size() freeWhenDone:NO]); 551 auto unarchiver = secureUnarchiverFromData(nsData.get()); 550 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:nsData.get()]); 551 [unarchiver setRequiresSecureCoding:YES]; 552 552 @try { 553 553 userObject = [unarchiver decodeObjectOfClass:[NSObject class] forKey:@"userObject"]; -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
r223908 r224023 66 66 #import <WebCore/HTMLInputElement.h> 67 67 #import <WebCore/MainFrame.h> 68 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>69 68 70 69 using namespace WebCore; … … 486 485 487 486 auto data = adoptNS([[NSMutableData alloc] init]); 488 auto archiver = secureArchiverFromMutableData(data.get()); 487 auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]); 488 [archiver setRequiresSecureCoding:YES]; 489 489 @try { 490 490 [archiver encodeObject:userObject forKey:@"userObject"]; -
trunk/Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm
r223908 r224023 35 35 #import "WebProcessCreationParameters.h" 36 36 #import <Foundation/NSBundle.h> 37 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>38 37 #import <stdio.h> 39 38 #import <wtf/RetainPtr.h> … … 87 86 auto bundleParameterData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(parameters.bundleParameterData->bytes())) length:parameters.bundleParameterData->size() freeWhenDone:NO]); 88 87 89 auto unarchiver = secureUnarchiverFromData(bundleParameterData.get()); 88 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:bundleParameterData.get()]); 89 [unarchiver setRequiresSecureCoding:YES]; 90 90 91 91 NSDictionary *dictionary = nil; … … 161 161 auto bundleParameterData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(value.data())) length:value.size() freeWhenDone:NO]); 162 162 163 auto unarchiver = secureUnarchiverFromData(bundleParameterData.get()); 163 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:bundleParameterData.get()]); 164 [unarchiver setRequiresSecureCoding:YES]; 164 165 165 166 id parameter = nil; … … 183 184 auto bundleParametersData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(value.data())) length:value.size() freeWhenDone:NO]); 184 185 185 auto unarchiver = secureUnarchiverFromData(bundleParametersData.get()); 186 auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:bundleParametersData.get()]); 187 [unarchiver setRequiresSecureCoding:YES]; 186 188 187 189 NSDictionary *parameters = nil;
Note: See TracChangeset
for help on using the changeset viewer.