Changeset 223900 in webkit


Ignore:
Timestamp:
Oct 24, 2017 11:14:03 AM (7 years ago)
Author:
Matt Lewis
Message:

Unreviewed, rolling out r223889.

This caused multiple crashes on all platforms

Reverted changeset:

"Adopt new secure coding APIs"
https://bugs.webkit.org/show_bug.cgi?id=178484
https://trac.webkit.org/changeset/223889

Location:
trunk/Source
Files:
1 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r223898 r223900  
     12017-10-24  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r223889.
     4
     5        This caused multiple crashes on all platforms
     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/223889
     12
    1132017-10-24  Antti Koivisto  <antti@apple.com>
    214
  • trunk/Source/WebCore/PAL/ChangeLog

    r223889 r223900  
     12017-10-24  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r223889.
     4
     5        This caused multiple crashes on all platforms
     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/223889
     12
    1132017-10-24  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj

    r223889 r223900  
    109109                1C4876D91F8D7F4E00CCEEBD /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4876D71F8D7F4E00CCEEBD /* Logging.h */; };
    110110                1C4876E01F8D837500CCEEBD /* LoggingCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C4876DF1F8D837500CCEEBD /* LoggingCocoa.mm */; };
    111                 7A1656441F97B2B900BA3CE4 /* NSKeyedArchiverSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */; };
    112111                A10265871F56746100B4C844 /* FoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265861F56746100B4C844 /* FoundationSPI.h */; };
    113112                A10265891F56747A00B4C844 /* HIToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265881F56747A00B4C844 /* HIToolboxSPI.h */; };
     
    251250                1C67CEA11E32EDA800F80F2E /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
    252251                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>"; };
    254252                A10265861F56746100B4C844 /* FoundationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoundationSPI.h; sourceTree = "<group>"; };
    255253                A10265881F56747A00B4C844 /* HIToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HIToolboxSPI.h; sourceTree = "<group>"; };
     
    365363                                0C2DA1321F3BEB4900DBC317 /* NSExtensionSPI.h */,
    366364                                0C2DA1331F3BEB4900DBC317 /* NSFileManagerSPI.h */,
    367                                 7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */,
    368365                                0C2DA1341F3BEB4900DBC317 /* NSStringSPI.h */,
    369366                                0C2DA1351F3BEB4900DBC317 /* NSTouchBarSPI.h */,
     
    654651                                A10826FE1F58A433004772AC /* NSGraphicsSPI.h in Headers */,
    655652                                0C7785911F45130F00F4EBB6 /* NSImmediateActionGestureRecognizerSPI.h in Headers */,
    656                                 7A1656441F97B2B900BA3CE4 /* NSKeyedArchiverSPI.h in Headers */,
    657653                                0C7785921F45130F00F4EBB6 /* NSMenuSPI.h in Headers */,
    658654                                0C7785931F45130F00F4EBB6 /* NSPasteboardSPI.h in Headers */,
  • trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm

    r223889 r223900  
    5353#import "markup.h"
    5454#import <pal/spi/cocoa/NSAttributedStringSPI.h>
    55 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    5655#import <wtf/BlockObjCExceptions.h>
    5756
     
    143142        return nullptr;
    144143
    145     return SharedBuffer::create(securelyArchivedDataWithRootObject(attributedString));
     144    return SharedBuffer::create([NSKeyedArchiver archivedDataWithRootObject:attributedString]);
    146145}
    147146
  • trunk/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm

    r223889 r223900  
    2727 */
    2828
    29 #import "config.h"
    30 #import "LegacyWebArchive.h"
    31 
    32 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
     29#include "config.h"
     30#include "LegacyWebArchive.h"
    3331
    3432namespace WebCore {
     
    4543   
    4644    NSURLResponse *response = nil;
    47     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];
    4849    @try {
    49 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS)
    5050        response = [unarchiver decodeObjectOfClass:[NSURLResponse class] forKey:LegacyWebArchiveResourceResponseKey];
    5151#else
    52         // Because of <rdar://problem/34063313> we can't use secure coding for decoding in older OS's.
    53         [unarchiver setRequiresSecureCoding:NO];
     52    @try {
    5453        id responseObject = [unarchiver decodeObjectForKey:LegacyWebArchiveResourceResponseKey];
    5554        if ([responseObject isKindOfClass:[NSURLResponse class]])
     
    6160        response = nil;
    6261    }
    63 
     62    [unarchiver release];
     63   
    6464    return ResourceResponse(response);
    6565}
     
    7474    CFMutableDataRef responseData = CFDataCreateMutable(0, 0);
    7575
    76     auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:(NSMutableData *)responseData]);
     76    NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:(NSMutableData *)responseData];
    7777#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS)
    7878    // Because of <rdar://problem/34063313> we can't use this for encoding in older OS's.
     
    8181    [archiver encodeObject:nsResponse forKey:LegacyWebArchiveResourceResponseKey];
    8282    [archiver finishEncoding];
    83 
     83    [archiver release];
     84   
    8485    return adoptCF(responseData);
    8586}
  • trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm

    r223889 r223900  
    11/*
    2  * Copyright (C) 2013-2017 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2013 Apple Inc.  All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3737#import <UIKit/UIImage.h>
    3838#import <UIKit/UIPasteboard.h>
    39 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    4039#import <pal/spi/ios/UIKitSPI.h>
    4140#import <wtf/ListHashSet.h>
     
    266265
    267266    if (content.dataInAttributedStringFormat) {
    268         NSAttributedString *attributedString = securelyUnarchiveObjectOfClassFromData([NSAttributedString class], content.dataInAttributedStringFormat->createNSData().get());
     267        NSAttributedString *attributedString = [NSKeyedUnarchiver unarchiveObjectWithData:content.dataInAttributedStringFormat->createNSData().get()];
    269268        if (attributedString)
    270269            [representationsToRegister addRepresentingObject:attributedString];
     
    381380            continue;
    382381
    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)];
    388387        if (![originInTeamData isKindOfClass:[NSString class]])
    389388            continue;
     
    446445            for (auto& type : data.orderedTypes)
    447446                [typesAsNSArray addObject:type];
    448             [representationsToRegister setTeamData:securelyArchivedDataWithRootObject(@{ @(originKeyForTeamData) : data.origin, @(customTypesKeyForTeamData) : typesAsNSArray })];
     447            [representationsToRegister setTeamData:[NSKeyedArchiver archivedDataWithRootObject:@{
     448                @(originKeyForTeamData) : data.origin, @(customTypesKeyForTeamData) : typesAsNSArray }]];
    449449            [representationsToRegister addData:serializedSharedBuffer.get() forType:@(PasteboardCustomData::cocoaType())];
    450450        }
  • trunk/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm

    r223889 r223900  
    3131#import <CFNetwork/CFNetwork.h>
    3232#import <pal/spi/cf/CFNetworkSPI.h>
    33 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    3433#import <wtf/NeverDestroyed.h>
    3534#import <wtf/RetainPtr.h>
     
    4241static CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseData)
    4342{
     43    RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData]);
    4444    NSURLResponse *response;
    45     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];
    4648    @try {
    47 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS)
    4849        response = [unarchiver decodeObjectOfClass:[NSURLResponse class] forKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
    4950#else
    50         // Because of <rdar://problem/34063313> we can't use secure coding for decoding in older OS's.
    51         [unarchiver setRequiresSecureCoding:NO];
     51    @try {
    5252        response = [unarchiver decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
    5353#endif
  • trunk/Source/WebKit/ChangeLog

    r223890 r223900  
     12017-10-24  Matt Lewis  <jlewis3@apple.com>
     2
     3        Unreviewed, rolling out r223889.
     4
     5        This caused multiple crashes on all platforms
     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/223889
     12
    1132017-10-24  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/Source/WebKit/Platform/ios/AccessibilityIOS.mm

    r223889 r223900  
    2626#import "config.h"
    2727#import "AccessibilityIOS.h"
    28 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    2928
    3029#if PLATFORM(IOS)
     
    3635    if (!uuid)
    3736        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 }];
    3938}
    4039
  • trunk/Source/WebKit/Shared/Cocoa/DataDetectionResult.mm

    r223889 r223900  
    11/*
    2  * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030#import "WebCoreArgumentCoders.h"
    3131#import <pal/spi/cocoa/DataDetectorsCoreSPI.h>
    32 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    3332#import <wtf/SoftLinking.h>
    3433
     
    4342{
    4443    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];
    4646    [archiver encodeObject:results.get() forKey:@"dataDetectorResults"];
    4747    [archiver finishEncoding];
     
    5555    if (!IPC::decode(decoder, data))
    5656        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];
    5960    @try {
    6061        result.results = [unarchiver decodeObjectOfClasses:[NSSet setWithArray:@[ [NSArray class], getDDScannerResultClass()] ] forKey:@"dataDetectorResults"];
  • trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm

    r223889 r223900  
    11/*
    2  * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131#import "DataReference.h"
    3232#import <WebCore/PaymentAuthorizationStatus.h>
    33 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    3433#import <pal/spi/cocoa/PassKitSPI.h>
    3534#import <wtf/SoftLinking.h>
     
    5352{
    5453    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];
    5657
    5758    [archiver encodeObject:payment.pkPayment() forKey:NSKeyedArchiveRootObjectKey];
     
    6869
    6970    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];
    7173    @try {
    7274        PKPayment *pkPayment = [unarchiver decodeObjectOfClass:getPKPaymentClass() forKey:NSKeyedArchiveRootObjectKey];
     
    105107{
    106108    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];
    108112
    109113    [archiver encodeObject:paymentContact.pkContact() forKey:NSKeyedArchiveRootObjectKey];
     
    120124
    121125    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];
    123128    @try {
    124129        PKContact *pkContact = [unarchiver decodeObjectOfClass:getPKContactClass() forKey:NSKeyedArchiveRootObjectKey];
     
    163168{
    164169    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];
    166173
    167174    [archiver encodeObject:paymentMerchantSession.pkPaymentMerchantSession() forKey:NSKeyedArchiveRootObjectKey];
     
    178185
    179186    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];
    181189    @try {
    182190        PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:getPKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey];
     
    188196
    189197    [unarchiver finishDecoding];
     198
    190199    return true;
    191200}
     
    194203{
    195204    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];
    197208
    198209    [archiver encodeObject:paymentMethod.pkPaymentMethod() forKey:NSKeyedArchiveRootObjectKey];
     
    209220
    210221    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];
    212224    @try {
    213225        PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:getPKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey];
  • trunk/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm

    r223889 r223900  
    11/*
    2  * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030#import "WebCoreArgumentCoders.h"
    3131#import <pal/spi/cocoa/DataDetectorsCoreSPI.h>
    32 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    3332#import <wtf/SoftLinking.h>
    3433
     
    7574        encoder << dataDetectorIdentifier;
    7675        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];
    7878        [archiver encodeObject:dataDetectorResults.get() forKey:@"dataDetectorResults"];
    7979        [archiver finishEncoding];
     
    169169            return false;
    170170       
    171         auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
     171        RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
     172        [unarchiver setRequiresSecureCoding:YES];
    172173        @try {
    173174            result.dataDetectorResults = [unarchiver decodeObjectOfClasses:[NSSet setWithArray:@[ [NSArray class], getDDScannerResultClass()] ] forKey:@"dataDetectorResults"];
  • trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm

    r223889 r223900  
    11/*
    2  * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010 Apple Inc. All rights reserved.
    33 * Copyright (C) 2013 Company 100 Inc. All rights reserved.
    44 *
     
    3939#import <WebCore/ResourceRequest.h>
    4040#import <pal/spi/cf/CFNetworkSPI.h>
    41 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    4241
    4342#if USE(CFURLCONNECTION)
     
    474473void ArgumentCoder<ProtectionSpace>::encodePlatformData(Encoder& encoder, const ProtectionSpace& space)
    475474{
    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];
    478478    [archiver encodeObject:space.nsSpace() forKey:@"protectionSpace"];
    479479    [archiver finishEncoding];
     
    487487        return false;
    488488
    489     auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
     489    RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
     490    [unarchiver setRequiresSecureCoding:YES];
    490491    @try {
    491492        if (RetainPtr<NSURLProtectionSpace> nsSpace = [unarchiver decodeObjectOfClass:[NSURLProtectionSpace class] forKey:@"protectionSpace"])
     
    519520
    520521    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];
    523525    [archiver encodeObject:nsCredential forKey:@"credential"];
    524526    [archiver finishEncoding];
     
    559561        return false;
    560562
    561     auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
     563    RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
     564    [unarchiver setRequiresSecureCoding:YES];
    562565    @try {
    563566        if (RetainPtr<NSURLCredential> nsCredential = [unarchiver decodeObjectOfClass:[NSURLCredential class] forKey:@"credential"])
     
    620623void ArgumentCoder<ContentFilterUnblockHandler>::encode(Encoder& encoder, const ContentFilterUnblockHandler& contentFilterUnblockHandler)
    621624{
    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];
    624628    contentFilterUnblockHandler.encode(archiver.get());
    625629    [archiver finishEncoding];
     
    633637        return false;
    634638
    635     auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
     639    RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
     640    [unarchiver setRequiresSecureCoding:YES];
    636641    if (!ContentFilterUnblockHandler::decode(unarchiver.get(), contentFilterUnblockHandler))
    637642        return false;
     
    652657void ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData(Encoder& encoder, const MediaPlaybackTargetContext& target)
    653658{
    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];
    656662
    657663    if ([getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
     
    672678        return false;
    673679
    674     auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
     680    RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
     681    [unarchiver setRequiresSecureCoding:YES];
    675682
    676683    AVOutputContext *context = nil;
  • trunk/Source/WebKit/Shared/mac/WebHitTestResultData.mm

    r223889 r223900  
    11/*
    2  * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434#import "WebCoreArgumentCoders.h"
    3535#import <WebCore/TextIndicator.h>
    36 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    3736#import <pal/spi/mac/DataDetectorsSPI.h>
    3837
     
    4645        return;
    4746
    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];
    5050    [archiver encodeObject:detectedDataActionContext.get() forKey:@"actionContext"];
    5151    [archiver finishEncoding];
     
    7676        return false;
    7777
    78     auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
     78    RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
     79    [unarchiver setRequiresSecureCoding:YES];
    7980    @try {
    8081        hitTestResultData.detectedDataActionContext = [unarchiver decodeObjectOfClass:getDDActionContextClass() forKey:@"actionContext"];
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm

    r223889 r223900  
    4949#import <WebCore/PluginData.h>
    5050#import <pal/spi/cf/CFNetworkSPI.h>
    51 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    5251#import <wtf/RetainPtr.h>
    5352
     
    215214
    216215    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];
    218218
    219219    @try {
     
    237237
    238238    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];
    240241
    241242    @try {
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r223889 r223900  
    103103#import <WebCore/ViewportArguments.h>
    104104#import <WebCore/WritingMode.h>
    105 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    106105#import <pal/spi/mac/NSTextFinderSPI.h>
    107106#import <wtf/BlockPtr.h>
     
    45274526            if (API::Data* data = static_cast<API::Data*>(userData)) {
    45284527                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];
    45304530                @try {
    45314531                    userObject = [unarchiver decodeObjectOfClass:[NSObject class] forKey:@"userObject"];
  • trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm

    r223889 r223900  
    5050#import <WebCore/SharedBuffer.h>
    5151#import <pal/spi/cf/CFNetworkSPI.h>
    52 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    5352#import <sys/param.h>
    5453
     
    217216    if (m_bundleParameters) {
    218217        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];
    220221
    221222        @try {
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r223889 r223900  
    5656#import <WebCore/TextIndicator.h>
    5757#import <WebCore/ValidationBubble.h>
    58 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    5958#import <wtf/BlockPtr.h>
    6059
     
    549548    if (API::Data* data = static_cast<API::Data*>(userData)) {
    550549        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];
    552552        @try {
    553553            userObject = [unarchiver decodeObjectOfClass:[NSObject class] forKey:@"userObject"];
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm

    r223889 r223900  
    6666#import <WebCore/HTMLInputElement.h>
    6767#import <WebCore/MainFrame.h>
    68 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    6968
    7069using namespace WebCore;
     
    486485
    487486            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];
    489489            @try {
    490490                [archiver encodeObject:userObject forKey:@"userObject"];
  • trunk/Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm

    r223889 r223900  
    3535#import "WebProcessCreationParameters.h"
    3636#import <Foundation/NSBundle.h>
    37 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
    3837#import <stdio.h>
    3938#import <wtf/RetainPtr.h>
     
    8786        auto bundleParameterData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(parameters.bundleParameterData->bytes())) length:parameters.bundleParameterData->size() freeWhenDone:NO]);
    8887
    89         auto unarchiver = secureUnarchiverFromData(bundleParameterData.get());
     88        auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:bundleParameterData.get()]);
     89        [unarchiver setRequiresSecureCoding:YES];
    9090
    9191        NSDictionary *dictionary = nil;
     
    161161    auto bundleParameterData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(value.data())) length:value.size() freeWhenDone:NO]);
    162162
    163     auto unarchiver = secureUnarchiverFromData(bundleParameterData.get());
     163    auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:bundleParameterData.get()]);
     164    [unarchiver setRequiresSecureCoding:YES];
    164165
    165166    id parameter = nil;
     
    183184    auto bundleParametersData = adoptNS([[NSData alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(value.data())) length:value.size() freeWhenDone:NO]);
    184185
    185     auto unarchiver = secureUnarchiverFromData(bundleParametersData.get());
     186    auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:bundleParametersData.get()]);
     187    [unarchiver setRequiresSecureCoding:YES];
    186188
    187189    NSDictionary *parameters = nil;
Note: See TracChangeset for help on using the changeset viewer.