<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[279710] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/279710">279710</a></dd>
<dt>Author</dt> <dd>wilander@apple.com</dd>
<dt>Date</dt> <dd>2021-07-07 22:09:53 -0700 (Wed, 07 Jul 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>PCM: Add error logging for CryptoKit operations
https://bugs.webkit.org/show_bug.cgi?id=227731
<rdar://80221057>

Reviewed by Brent Fulgham.

Resolves three FIXMEs for error logging in PCM's CryptoKit operations.

Source/WebCore:

No new tests. Only added logging.

* loader/PrivateClickMeasurement.h:
* loader/cocoa/PrivateClickMeasurementCocoa.mm:
(WebCore::PrivateClickMeasurement::calculateAndUpdateSourceUnlinkableToken):
(WebCore::PrivateClickMeasurement::calculateAndUpdateSourceSecretToken):

Source/WebKit:

* NetworkProcess/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::storeUnattributed):
(WebKit::PrivateClickMeasurementManager::getSignedUnlinkableToken):

Tools:

* TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
(TestWebKitAPI::TEST):
    Now expects an optional string instead of a bool from the function
    calls which means EXPECT_TRUE has become EXPECT_FALSE. The optional
    string is non-nullopt if it carries an error message.
* TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm:
(TestWebKitAPI::TEST):
    Now expects an optional string instead of a bool from the function
    calls which means EXPECT_TRUE has become EXPECT_FALSE. The optional
    string is non-nullopt if it carries an error message.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderPrivateClickMeasurementh">trunk/Source/WebCore/loader/PrivateClickMeasurement.h</a></li>
<li><a href="#trunkSourceWebCoreloadercocoaPrivateClickMeasurementCocoamm">trunk/Source/WebCore/loader/cocoa/PrivateClickMeasurementCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessPrivateClickMeasurementManagercpp">trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCorePrivateClickMeasurementcpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCorecocoaPrivateClickMeasurementCocoamm">trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (279709 => 279710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-07-08 04:48:27 UTC (rev 279709)
+++ trunk/Source/WebCore/ChangeLog      2021-07-08 05:09:53 UTC (rev 279710)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2021-07-07  John Wilander  <wilander@apple.com>
+
+        PCM: Add error logging for CryptoKit operations
+        https://bugs.webkit.org/show_bug.cgi?id=227731
+        <rdar://80221057>
+
+        Reviewed by Brent Fulgham.
+
+        Resolves three FIXMEs for error logging in PCM's CryptoKit operations.
+
+        No new tests. Only added logging.
+
+        * loader/PrivateClickMeasurement.h:
+        * loader/cocoa/PrivateClickMeasurementCocoa.mm:
+        (WebCore::PrivateClickMeasurement::calculateAndUpdateSourceUnlinkableToken):
+        (WebCore::PrivateClickMeasurement::calculateAndUpdateSourceSecretToken):
+
</ins><span class="cx"> 2021-07-07  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Our structured cloning implementation does not encode all of RegExp's flags
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPrivateClickMeasurementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PrivateClickMeasurement.h (279709 => 279710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PrivateClickMeasurement.h    2021-07-08 04:48:27 UTC (rev 279709)
+++ trunk/Source/WebCore/loader/PrivateClickMeasurement.h       2021-07-08 05:09:53 UTC (rev 279710)
</span><span class="lines">@@ -354,8 +354,8 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-    WEBCORE_EXPORT bool calculateAndUpdateSourceUnlinkableToken(const String& serverPublicKeyBase64URL);
-    WEBCORE_EXPORT bool calculateAndUpdateSourceSecretToken(const String& serverResponseBase64URL);
</del><ins>+    WEBCORE_EXPORT std::optional<String> calculateAndUpdateSourceUnlinkableToken(const String& serverPublicKeyBase64URL);
+    WEBCORE_EXPORT std::optional<String> calculateAndUpdateSourceSecretToken(const String& serverResponseBase64URL);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void setSourceUnlinkableTokenValue(const String& value) { m_sourceUnlinkableToken.valueBase64URL = value; }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercocoaPrivateClickMeasurementCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cocoa/PrivateClickMeasurementCocoa.mm (279709 => 279710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cocoa/PrivateClickMeasurementCocoa.mm        2021-07-08 04:48:27 UTC (rev 279709)
+++ trunk/Source/WebCore/loader/cocoa/PrivateClickMeasurementCocoa.mm   2021-07-08 05:09:53 UTC (rev 279710)
</span><span class="lines">@@ -30,50 +30,56 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-bool PrivateClickMeasurement::calculateAndUpdateSourceUnlinkableToken(const String& serverPublicKeyBase64URL)
</del><ins>+std::optional<String> PrivateClickMeasurement::calculateAndUpdateSourceUnlinkableToken(const String& serverPublicKeyBase64URL)
</ins><span class="cx"> {
</span><span class="cx"> #if HAVE(RSA_BSSA)
</span><span class="cx">     {
</span><span class="cx">         auto serverPublicKeyData = base64URLDecode(serverPublicKeyBase64URL);
</span><span class="cx">         if (!serverPublicKeyData)
</span><del>-            return false;
</del><ins>+            return "Could not decode the source's public key data."_s;
</ins><span class="cx">         auto serverPublicKey = adoptNS([[NSData alloc] initWithBytes:serverPublicKeyData->data() length:serverPublicKeyData->size()]);
</span><span class="cx"> 
</span><del>-        // FIXME(222018): Check error.
-        m_sourceUnlinkableToken.blinder = adoptNS([PAL::allocRSABSSATokenBlinderInstance() initWithPublicKey:serverPublicKey.get() error:nullptr]);
</del><ins>+        NSError* nsError = 0;
+        m_sourceUnlinkableToken.blinder = adoptNS([PAL::allocRSABSSATokenBlinderInstance() initWithPublicKey:serverPublicKey.get() error:&nsError]);
+        if (nsError)
+            return nsError.localizedDescription;
</ins><span class="cx">         if (!m_sourceUnlinkableToken.blinder)
</span><del>-            return false;
</del><ins>+            return "Did not get a source unlinkable token blinder."_s;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // FIXME(222018): Check error.
-    m_sourceUnlinkableToken.waitingToken = [m_sourceUnlinkableToken.blinder tokenWaitingActivationWithContent:nullptr error:nullptr];
</del><ins>+    NSError* nsError = 0;
+    m_sourceUnlinkableToken.waitingToken = [m_sourceUnlinkableToken.blinder tokenWaitingActivationWithContent:nullptr error:&nsError];
+    if (nsError)
+        return nsError.localizedDescription;
</ins><span class="cx">     if (!m_sourceUnlinkableToken.waitingToken)
</span><del>-        return false;
</del><ins>+        return "Did not get a source unlinkable token waiting token."_s;
</ins><span class="cx"> 
</span><span class="cx">     m_sourceUnlinkableToken.valueBase64URL = base64URLEncodeToString([m_sourceUnlinkableToken.waitingToken blindedMessage].bytes, [m_sourceUnlinkableToken.waitingToken blindedMessage].length);
</span><del>-    return true;
</del><ins>+    return std::nullopt;
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(serverPublicKeyBase64URL);
</span><del>-    return false;
</del><ins>+    return "Unlinkable tokens are not supported by this platform."_s;
</ins><span class="cx"> #endif // HAVE(RSA_BSSA)
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PrivateClickMeasurement::calculateAndUpdateSourceSecretToken(const String& serverResponseBase64URL)
</del><ins>+std::optional<String> PrivateClickMeasurement::calculateAndUpdateSourceSecretToken(const String& serverResponseBase64URL)
</ins><span class="cx"> {
</span><span class="cx"> #if HAVE(RSA_BSSA)
</span><span class="cx">     if (!m_sourceUnlinkableToken.waitingToken)
</span><del>-        return false;
</del><ins>+        return "Did not find a source unlinkable token waiting token."_s;
</ins><span class="cx"> 
</span><span class="cx">     {
</span><span class="cx">         auto serverResponseData = base64URLDecode(serverResponseBase64URL);
</span><span class="cx">         if (!serverResponseData)
</span><del>-            return false;
</del><ins>+            return "Could not decode source response data."_s;
</ins><span class="cx">         auto serverResponse = adoptNS([[NSData alloc] initWithBytes:serverResponseData->data() length:serverResponseData->size()]);
</span><span class="cx"> 
</span><del>-        // FIXME(222018): Check error.
-        m_sourceUnlinkableToken.readyToken = [m_sourceUnlinkableToken.waitingToken activateTokenWithServerResponse:serverResponse.get() error:nullptr];
</del><ins>+        NSError* nsError = 0;
+        m_sourceUnlinkableToken.readyToken = [m_sourceUnlinkableToken.waitingToken activateTokenWithServerResponse:serverResponse.get() error:&nsError];
+        if (nsError)
+            return nsError.localizedDescription;
</ins><span class="cx">         if (!m_sourceUnlinkableToken.readyToken)
</span><del>-            return false;
</del><ins>+            return "Did not get a source unlinkable token ready token."_s;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     SourceSecretToken token;
</span><span class="lines">@@ -82,10 +88,10 @@
</span><span class="cx">     token.signatureBase64URL = base64URLEncodeToString([m_sourceUnlinkableToken.readyToken signature].bytes, [m_sourceUnlinkableToken.readyToken signature].length);
</span><span class="cx"> 
</span><span class="cx">     m_sourceSecretToken = WTFMove(token);
</span><del>-    return true;
</del><ins>+    return std::nullopt;
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(serverResponseBase64URL);
</span><del>-    return false;
</del><ins>+    return "Unlinkable tokens are not supported by this platform."_s;
</ins><span class="cx"> #endif // HAVE(RSA_BSSA)
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (279709 => 279710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-07-08 04:48:27 UTC (rev 279709)
+++ trunk/Source/WebKit/ChangeLog       2021-07-08 05:09:53 UTC (rev 279710)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2021-07-07  John Wilander  <wilander@apple.com>
+
+        PCM: Add error logging for CryptoKit operations
+        https://bugs.webkit.org/show_bug.cgi?id=227731
+        <rdar://80221057>
+
+        Reviewed by Brent Fulgham.
+
+        Resolves three FIXMEs for error logging in PCM's CryptoKit operations.
+
+        * NetworkProcess/PrivateClickMeasurementManager.cpp:
+        (WebKit::PrivateClickMeasurementManager::storeUnattributed):
+        (WebKit::PrivateClickMeasurementManager::getSignedUnlinkableToken):
+
</ins><span class="cx"> 2021-07-07  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Extremely jumpy window resizing in MiniBrowser
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessPrivateClickMeasurementManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp (279709 => 279710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp    2021-07-08 04:48:27 UTC (rev 279709)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp       2021-07-08 05:09:53 UTC (rev 279710)
</span><span class="lines">@@ -88,8 +88,11 @@
</span><span class="cx">                 attribution.setSourceUnlinkableTokenValue(m_fraudPreventionValuesForTesting->unlinkableToken);
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">             else {
</span><del>-                if (!attribution.calculateAndUpdateSourceUnlinkableToken(publicKeyBase64URL))
</del><ins>+                if (auto errorMessage = attribution.calculateAndUpdateSourceUnlinkableToken(publicKeyBase64URL)) {
+                    RELEASE_LOG_INFO(PrivateClickMeasurement, "Got the following error in calculateAndUpdateSourceUnlinkableToken(): '%{public}s", errorMessage->utf8().data());
+                    m_networkProcess->broadcastConsoleMessage(m_sessionID, MessageSource::PrivateClickMeasurement, MessageLevel::Error, makeString("[Private Click Measurement] "_s, *errorMessage));
</ins><span class="cx">                     return;
</span><ins>+                }
</ins><span class="cx">             }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -221,8 +224,11 @@
</span><span class="cx">             attribution.setSourceSecretToken({ m_fraudPreventionValuesForTesting->secretToken, m_fraudPreventionValuesForTesting->signature, m_fraudPreventionValuesForTesting->keyID });
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">         else {
</span><del>-            if (!attribution.calculateAndUpdateSourceSecretToken(signatureBase64URL))
</del><ins>+            if (auto errorMessage = attribution.calculateAndUpdateSourceSecretToken(signatureBase64URL)) {
+                RELEASE_LOG_INFO(PrivateClickMeasurement, "Got the following error in calculateAndUpdateSourceSecretToken(): '%{public}s", errorMessage->utf8().data());
+                m_networkProcess->broadcastConsoleMessage(m_sessionID, MessageSource::PrivateClickMeasurement, MessageLevel::Error, makeString("[Private Click Measurement] "_s, *errorMessage));
</ins><span class="cx">                 return;
</span><ins>+            }
</ins><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (279709 => 279710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-07-08 04:48:27 UTC (rev 279709)
+++ trunk/Tools/ChangeLog       2021-07-08 05:09:53 UTC (rev 279710)
</span><span class="lines">@@ -1,5 +1,26 @@
</span><span class="cx"> 2021-07-07  John Wilander  <wilander@apple.com>
</span><span class="cx"> 
</span><ins>+        PCM: Add error logging for CryptoKit operations
+        https://bugs.webkit.org/show_bug.cgi?id=227731
+        <rdar://80221057>
+
+        Reviewed by Brent Fulgham.
+
+        Resolves three FIXMEs for error logging in PCM's CryptoKit operations.
+
+        * TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:
+        (TestWebKitAPI::TEST):
+            Now expects an optional string instead of a bool from the function
+            calls which means EXPECT_TRUE has become EXPECT_FALSE. The optional
+            string is non-nullopt if it carries an error message.
+        * TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm:
+        (TestWebKitAPI::TEST):
+            Now expects an optional string instead of a bool from the function
+            calls which means EXPECT_TRUE has become EXPECT_FALSE. The optional
+            string is non-nullopt if it carries an error message.
+
+2021-07-07  John Wilander  <wilander@apple.com>
+
</ins><span class="cx">         PCM: API test PrivateClickMeasurement.ValidBlindedSecret is failing on platforms with RSABSSA
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=227777
</span><span class="cx">         <rdar://80291822>
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCorePrivateClickMeasurementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp (279709 => 279710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp      2021-07-08 04:48:27 UTC (rev 279709)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp 2021-07-08 05:09:53 UTC (rev 279710)
</span><span class="lines">@@ -320,11 +320,13 @@
</span><span class="cx">     EXPECT_TRUE(ephemeralNonce.isValid());
</span><span class="cx">     pcm.setEphemeralSourceNonce(WTFMove(ephemeralNonce));
</span><span class="cx"> 
</span><del>-    EXPECT_TRUE(pcm.calculateAndUpdateSourceUnlinkableToken(serverPublicKeyBase64URL));
</del><ins>+    auto errorMessage = pcm.calculateAndUpdateSourceUnlinkableToken(serverPublicKeyBase64URL);
+    EXPECT_FALSE(errorMessage);
</ins><span class="cx">     sourceUnlinkableToken = pcm.tokenSignatureJSON();
</span><span class="cx">     EXPECT_EQ(sourceUnlinkableToken->asObject()->size(), 4ul);
</span><span class="cx"> 
</span><del>-    EXPECT_FALSE(pcm.calculateAndUpdateSourceSecretToken(emptyString()));
</del><ins>+    errorMessage = pcm.calculateAndUpdateSourceSecretToken(emptyString());
+    EXPECT_TRUE(errorMessage);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCorecocoaPrivateClickMeasurementCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm (279709 => 279710)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm    2021-07-08 04:48:27 UTC (rev 279709)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm       2021-07-08 05:09:53 UTC (rev 279710)
</span><span class="lines">@@ -76,7 +76,8 @@
</span><span class="cx">     auto *nsSpkiData = (__bridge NSData *)spkiData.get();
</span><span class="cx"> 
</span><span class="cx">     // Continue the test.
</span><del>-    EXPECT_TRUE(pcm.calculateAndUpdateSourceUnlinkableToken(base64URLEncodeToString(nsSpkiData.bytes, nsSpkiData.length)));
</del><ins>+    auto errorMessage = pcm.calculateAndUpdateSourceUnlinkableToken(base64URLEncodeToString(nsSpkiData.bytes, nsSpkiData.length));
+    EXPECT_FALSE(errorMessage);
</ins><span class="cx">     auto sourceUnlinkableToken = pcm.tokenSignatureJSON();
</span><span class="cx">     EXPECT_EQ(sourceUnlinkableToken->asObject()->size(), 4ul);
</span><span class="cx">     EXPECT_STREQ(sourceUnlinkableToken->getString("source_engagement_type"_s).utf8().data(), "click");
</span><span class="lines">@@ -91,7 +92,8 @@
</span><span class="cx">     ccrsabssa_sign_blinded_message(ciphersuite, rsaPrivateKey, blindedMessage->data(), blindedMessage->size(), static_cast<uint8_t *>([blindedSignature mutableBytes]), [blindedSignature length], rng);
</span><span class="cx"> 
</span><span class="cx">     // Continue the test.
</span><del>-    EXPECT_TRUE(pcm.calculateAndUpdateSourceSecretToken(base64URLEncodeToString([blindedSignature bytes], [blindedSignature length])));
</del><ins>+    errorMessage = pcm.calculateAndUpdateSourceSecretToken(base64URLEncodeToString([blindedSignature bytes], [blindedSignature length]));
+    EXPECT_FALSE(errorMessage);
</ins><span class="cx">     auto& persistentToken = pcm.sourceUnlinkableToken();
</span><span class="cx">     EXPECT_TRUE(persistentToken);
</span><span class="cx">     EXPECT_FALSE(persistentToken->tokenBase64URL.isEmpty());
</span></span></pre>
</div>
</div>

</body>
</html>