Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: components/cronet/ios/Cronet.h

Issue 2928653002: [Cronet-iOS] Public-Key-Pinning Tests (Closed)
Patch Set: Build fix on bot Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Foundation/Foundation.h> 5 #import <Foundation/Foundation.h>
6 6
7 #include "bidirectional_stream_c.h" 7 #include "bidirectional_stream_c.h"
8 8
9 // TODO(mef): Remove this header after transition to bidirectional_stream_c.h 9 // TODO(mef): Remove this header after transition to bidirectional_stream_c.h
10 // See crbug.com/650462 for details. 10 // See crbug.com/650462 for details.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // If |partial| is set to NO, then |userAgent| value is complete value sent to 66 // If |partial| is set to NO, then |userAgent| value is complete value sent to
67 // the remote. For Example: "Foo/3.0.0.0" is sent as "Foo/3.0.0.0". 67 // the remote. For Example: "Foo/3.0.0.0" is sent as "Foo/3.0.0.0".
68 // 68 //
69 // This method only has any effect before |start| is called. 69 // This method only has any effect before |start| is called.
70 + (void)setUserAgent:(NSString*)userAgent partial:(BOOL)partial; 70 + (void)setUserAgent:(NSString*)userAgent partial:(BOOL)partial;
71 71
72 // Sets SSLKEYLogFileName to export SSL key for Wireshark decryption of packet 72 // Sets SSLKEYLogFileName to export SSL key for Wireshark decryption of packet
73 // captures. This method only has any effect before |start| is called. 73 // captures. This method only has any effect before |start| is called.
74 + (void)setSslKeyLogFileName:(NSString*)sslKeyLogFileName; 74 + (void)setSslKeyLogFileName:(NSString*)sslKeyLogFileName;
75 75
76 // <p>
lilyhoughton 2017/06/09 16:51:57 Can the html be replaced with something more like
kapishnikov 2017/06/09 21:27:01 Done.
77 // Pins a set of public keys for a given host. This method only has any effect
78 // before |start| is called. By pinning a set of public keys,
79 // |pinsSha256|, communication with |hostName| is required to
80 // authenticate with a certificate with a public key from the set of pinned
81 // ones. An app can pin the public key of the root certificate, any of the
82 // intermediate certificates or the end-entry certificate. Authentication will
83 // fail and secure communication will not be established if none of the public
84 // keys is present in the host's certificate chain, even if the host attempts to
85 // authenticate with a certificate allowed by the device's trusted store of
86 // certificates.
87 // </p>
88 // <p>
89 // Calling this method multiple times with the same host name overrides the
90 // previously set pins for the host.
91 // </p>
92 // <p>
93 // More information about the public key pinning can be found in
94 // <a href="https://tools.ietf.org/html/rfc7469">RFC 7469</a>.
95 // </p>
96 //
97 // @param hostName name of the host to which the public keys should be pinned. A
lilyhoughton 2017/06/09 16:51:57 We also don't have @params for any of the other fu
kapishnikov 2017/06/09 21:27:01 I think we should. The correct way of documenting
98 // host that
99 // consists only of digits and the dot character is treated as
100 // invalid.
101 // @param pinsSha256 a set of pins. Each pin is the SHA-256 cryptographic
102 // hash of the DER-encoded ASN.1 representation of the Subject
103 // Public Key Info (SPKI) of the host's X.509 certificate.
104 // Although, the method does not mandate the presence of the
105 // backup pin that can be used if the control of the primary
106 // private key has been lost, it is highly recommended to
107 // supply one.
108 // @param includeSubdomains indicates whether the pinning policy should be
109 // applied to
110 // subdomains of {@code hostName}.
lilyhoughton 2017/06/09 16:51:57 is {@code hostName} different from |hostName|?
kapishnikov 2017/06/09 21:27:01 This is the result of copy-paste. Fixed.
111 // @param expirationDate specifies the expiration date for the pins.
112 + (void)addPublicKeyPinsForHost:(NSString*)host
113 pinHashes:(NSSet<NSData*>*)pinHashes
114 includeSubdomains:(BOOL)includeSubdomains
115 expirationDate:(NSDate*)expirationDate;
116
76 // Sets the block used to determine whether or not Cronet should handle the 117 // Sets the block used to determine whether or not Cronet should handle the
77 // request. If the block is not set, Cronet will handle all requests. Cronet 118 // request. If the block is not set, Cronet will handle all requests. Cronet
78 // retains strong reference to the block, which can be released by calling this 119 // retains strong reference to the block, which can be released by calling this
79 // method with nil block. 120 // method with nil block.
80 + (void)setRequestFilterBlock:(RequestFilterBlock)block; 121 + (void)setRequestFilterBlock:(RequestFilterBlock)block;
81 122
82 // Starts CronetEngine. It is recommended to call this method on the application 123 // Starts CronetEngine. It is recommended to call this method on the application
83 // main thread. If the method is called on any thread other than the main one, 124 // main thread. If the method is called on any thread other than the main one,
84 // the method will internally try to execute synchronously using the main GCD 125 // the method will internally try to execute synchronously using the main GCD
85 // queue. Please make sure that the main thread is not blocked by a job 126 // queue. Please make sure that the main thread is not blocked by a job
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 178
138 // Sets Host Resolver Rules for testing. 179 // Sets Host Resolver Rules for testing.
139 // This method must be called after |start| has been called. 180 // This method must be called after |start| has been called.
140 + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting; 181 + (void)setHostResolverRulesForTesting:(NSString*)hostResolverRulesForTesting;
141 182
142 // Enables TestCertVerifier which accepts all certificates for testing. 183 // Enables TestCertVerifier which accepts all certificates for testing.
143 // This method only has any effect before |start| is called. 184 // This method only has any effect before |start| is called.
144 + (void)enableTestCertVerifierForTesting; 185 + (void)enableTestCertVerifierForTesting;
145 186
146 @end 187 @end
OLDNEW
« no previous file with comments | « no previous file | components/cronet/ios/Cronet.mm » ('j') | components/cronet/ios/cronet_environment.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698