Bug 230137

Summary: Add infrastructure to allow TLS during PCM tests
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, cdumez, cgarcia, ews-watchlist, gustavo, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch wilander: review+

Description Alex Christensen 2021-09-09 16:57:24 PDT
Add infrastructure to allow TLS during PCM tests
Comment 1 Alex Christensen 2021-09-09 17:00:57 PDT
Created attachment 437809 [details]
Patch
Comment 2 EWS Watchlist 2021-09-09 17:01:39 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Alex Christensen 2021-09-09 17:05:45 PDT
Created attachment 437810 [details]
Patch
Comment 4 Alex Christensen 2021-09-09 19:54:29 PDT
Created attachment 437829 [details]
Patch
Comment 5 Alex Christensen 2021-09-09 20:52:11 PDT
Created attachment 437832 [details]
Patch
Comment 6 Alex Christensen 2021-09-09 22:54:18 PDT
Created attachment 437836 [details]
Patch
Comment 7 Alex Christensen 2021-09-09 23:33:55 PDT
Created attachment 437841 [details]
Patch
Comment 8 Alex Christensen 2021-09-09 23:51:20 PDT
Created attachment 437844 [details]
Patch
Comment 9 EWS 2021-09-10 08:19:54 PDT
Committed r282269 (241547@main): <https://commits.webkit.org/241547@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437844 [details].
Comment 10 Radar WebKit Bug Importer 2021-09-10 09:14:03 PDT
<rdar://problem/82975108>
Comment 11 John Wilander 2021-09-10 16:21:32 PDT
Comment on attachment 437844 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437844&action=review

> Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDecoder.cpp:52
> +const uint8_t* Decoder::decodeFixedLengthReference(size_t size, size_t)

Is this just testing infrastructure? If so, should we name it as such?

> Source/WebKit/NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementNetworkLoaderCocoa.mm:43
> +    if (![challenge.protectionSpace.host isEqualToString:@"127.0.0.1"]

I know we've talked several times about having these known local test server hosts statically available somewhere so we don't have to spread these stings out.

> Source/WebKit/NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementNetworkLoaderCocoa.mm:113
> +    if (allowedLocalTestServerTrust() && url.host() != "127.0.0.1")

Ditto on the host.

> Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:-1646
> -

Accidental?
Comment 12 Alex Christensen 2021-09-13 08:59:38 PDT
(In reply to John Wilander from comment #11)
> Comment on attachment 437844 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=437844&action=review
> 
> > Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDecoder.cpp:52
> > +const uint8_t* Decoder::decodeFixedLengthReference(size_t size, size_t)
This is used by many types to decode a DataReference.  Right now it's only used for CertificateInfo decoding in testing stuff, but its signature needs to look just like this.  It will likely be used for other things in the future.

> > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:-1646
> > -
> 
> Accidental?
Kind of.
Comment 13 John Wilander 2021-09-13 09:06:34 PDT
(In reply to Alex Christensen from comment #12)
> (In reply to John Wilander from comment #11)
> > Comment on attachment 437844 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=437844&action=review
> > 
> > > Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDecoder.cpp:52
> > > +const uint8_t* Decoder::decodeFixedLengthReference(size_t size, size_t)
> This is used by many types to decode a DataReference.  Right now it's only
> used for CertificateInfo decoding in testing stuff, but its signature needs
> to look just like this.  It will likely be used for other things in the
> future.

Yeah, that code made more sense not labeled as testing when I got to the rest of the patch. In the beginning it looked like complex, risky code added just for testing and I was worried others wouldn't know it was for testing. But then I realized it's just general encode/decode.

> > > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:-1646
> > > -
> > 
> > Accidental?
> Kind of.