DescriptionFix certificate and keychain installation on Android.
This patch is necessary to allow Chrome on Android to properly
install CA certificates and PKCS#12 keychains. This feature is
not supported on other platforms, but necessary on mobile.
It does modify the content client API to deal with the new
file types, i.e. the AddNewCertificate() method is renamed
AddCryptoFile(), and its signature changed to receive the
file data directly (along with a file type enum).
It is now the reponsability of the browser / content embedder
to perform certificate verification.
More specifically:
- Modify net/base/mime_util.h to provide two new functions:
* IsSupportedCertificateMimeType(), which returns true iff
a mime type corresponds to a supported crypto file
(only "application/x-x509-user-cert" is supported,
except on Android, which adds ".../x-x509-ca-cert" and
".../x-pkcs12").
* GetCertificateMimeTypeForMimeType() which translates a
mime type string into an enum value that is also
understood from Java (see below), describing the
type of file.
Note that "net/base/mime_util_certificate_list.h" is used to hold
the list of certificate mime type constants, both for C++ and Java
(i.e. it is used to auto-generate org.chromium.net.CertificateMimeType.java
at build time, under out/$BUILDTYPE/gen/template/).
- Rename X509UserCertResourceHandler to CertificateResourceHandler
under content/browser/loader/ in order to deal with
all certificate mime types. Modify buffered_resource_handler.cc
appropriately.
- Add net::android::StoreCertificate(), and the Java
org.chromium.net.AndroidNetworkLibrary.storeCertificate()
method to send the certificate data for installation through
the system's CertInstaller activity.
- Add chrome::SSLAddCertificate() to implement the
platform-specific code that used to be in
content::ContentBrowserClient::AddNewCertificate().
- Rename content::ContentBrowserClient::AddNewCertificate()
to ::AddCertificate(), and change its signature to accept
resource file bytes directly and a net::CertificateMimeType
(was an X509Certificate pointer).
This change shall not modify the behaviour of Chromium on other
platforms.
BUG=149306
TEST=Manual test with ChromiumTestShell, see internal b/6668254 for details.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=172350
Patch Set 1 #
Total comments: 8
Patch Set 2 : #
Total comments: 24
Patch Set 3 : Implement Ryan's suggested improvements #
Total comments: 7
Patch Set 4 : move some code to chrome/browser/ssl/ #
Total comments: 13
Patch Set 5 : rename CertificateType to CertificateMimeType #
Total comments: 6
Patch Set 6 : Fix indentation and Java constants #Patch Set 7 : Really fix indentation. #Patch Set 8 : auto-generate Java constants + rebase #
Total comments: 2
Patch Set 9 : git cl try #Patch Set 10 : remove obsolete constants #
Total comments: 1
Patch Set 11 : separate android and openssl CertDatabase implementations #Messages
Total messages: 26 (0 generated)
|