about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch
blob: d43b09b953833f793baaf88fe61b7097cfa28959 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
Fix build against 10.10 SDK

The SecKey part perhaps could be fixed by implementing a revert to
https://chromium.googlesource.com/chromium/src.git/+/8418e098b9cbedf884878b61dcd3292c515845cf%5E%21/#F0

--- a/src/3rdparty/chromium/content/browser/renderer_host/input/web_input_event_builders_mac.mm
+++ b/src/3rdparty/chromium/content/browser/renderer_host/input/web_input_event_builders_mac.mm
@@ -1,3 +1,4 @@
+#define NSEventTypeScrollWheel 22
 // Copyright 2015 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
--- a/src/3rdparty/chromium/net/ssl/ssl_platform_key_mac.cc
+++ b/src/3rdparty/chromium/net/ssl/ssl_platform_key_mac.cc
@@ -48,21 +48,6 @@ namespace net {
 
 namespace {
 
-// TODO(davidben): Remove this when we switch to building to the 10.13
-// SDK. https://crbug.com/780980
-#if !defined(MAC_OS_X_VERSION_10_13) || \
-    MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
-API_AVAILABLE(macosx(10.13))
-const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA256 =
-    CFSTR("algid:sign:RSA:digest-PSS:SHA256:SHA256:32");
-API_AVAILABLE(macosx(10.13))
-const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA384 =
-    CFSTR("algid:sign:RSA:digest-PSS:SHA384:SHA384:48");
-API_AVAILABLE(macosx(10.13))
-const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA512 =
-    CFSTR("algid:sign:RSA:digest-PSS:SHA512:SHA512:64");
-#endif
-
 class ScopedCSSM_CC_HANDLE {
  public:
   ScopedCSSM_CC_HANDLE() : handle_(0) {}
@@ -187,109 +172,6 @@ class SSLPlatformKeyCSSM : public ThreadedSSLPrivateKey::Delegate {
   DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyCSSM);
 };
 
-// Returns the corresponding SecKeyAlgorithm or nullptr if unrecognized.
-API_AVAILABLE(macosx(10.12))
-SecKeyAlgorithm GetSecKeyAlgorithm(uint16_t algorithm) {
-  switch (algorithm) {
-    case SSL_SIGN_RSA_PKCS1_SHA512:
-      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA512;
-    case SSL_SIGN_RSA_PKCS1_SHA384:
-      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA384;
-    case SSL_SIGN_RSA_PKCS1_SHA256:
-      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256;
-    case SSL_SIGN_RSA_PKCS1_SHA1:
-      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1;
-    case SSL_SIGN_RSA_PKCS1_MD5_SHA1:
-      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15Raw;
-    case SSL_SIGN_ECDSA_SECP521R1_SHA512:
-      return kSecKeyAlgorithmECDSASignatureDigestX962SHA512;
-    case SSL_SIGN_ECDSA_SECP384R1_SHA384:
-      return kSecKeyAlgorithmECDSASignatureDigestX962SHA384;
-    case SSL_SIGN_ECDSA_SECP256R1_SHA256:
-      return kSecKeyAlgorithmECDSASignatureDigestX962SHA256;
-    case SSL_SIGN_ECDSA_SHA1:
-      return kSecKeyAlgorithmECDSASignatureDigestX962SHA1;
-  }
-
-  if (base::mac::IsAtLeastOS10_13()) {
-    switch (algorithm) {
-      case SSL_SIGN_RSA_PSS_SHA512:
-        return kSecKeyAlgorithmRSASignatureDigestPSSSHA512;
-      case SSL_SIGN_RSA_PSS_SHA384:
-        return kSecKeyAlgorithmRSASignatureDigestPSSSHA384;
-      case SSL_SIGN_RSA_PSS_SHA256:
-        return kSecKeyAlgorithmRSASignatureDigestPSSSHA256;
-    }
-  }
-
-  return nullptr;
-}
-
-class API_AVAILABLE(macosx(10.12)) SSLPlatformKeySecKey
-    : public ThreadedSSLPrivateKey::Delegate {
- public:
-  SSLPlatformKeySecKey(int type, size_t max_length, SecKeyRef key)
-      : key_(key, base::scoped_policy::RETAIN) {
-    // Determine the algorithms supported by the key.
-    for (uint16_t algorithm : SSLPrivateKey::DefaultAlgorithmPreferences(
-             type, true /* include PSS */)) {
-      SecKeyAlgorithm sec_algorithm = GetSecKeyAlgorithm(algorithm);
-      if (sec_algorithm &&
-          SecKeyIsAlgorithmSupported(key_.get(), kSecKeyOperationTypeSign,
-                                     sec_algorithm)) {
-        preferences_.push_back(algorithm);
-      }
-    }
-  }
-
-  ~SSLPlatformKeySecKey() override {}
-
-  std::vector<uint16_t> GetAlgorithmPreferences() override {
-    return preferences_;
-  }
-
-  Error Sign(uint16_t algorithm,
-             base::span<const uint8_t> input,
-             std::vector<uint8_t>* signature) override {
-    SecKeyAlgorithm sec_algorithm = GetSecKeyAlgorithm(algorithm);
-    if (!sec_algorithm) {
-      NOTREACHED();
-      return ERR_FAILED;
-    }
-
-    const EVP_MD* md = SSL_get_signature_algorithm_digest(algorithm);
-    uint8_t digest[EVP_MAX_MD_SIZE];
-    unsigned digest_len;
-    if (!md || !EVP_Digest(input.data(), input.size(), digest, &digest_len, md,
-                           nullptr)) {
-      return ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED;
-    }
-
-    base::ScopedCFTypeRef<CFDataRef> digest_ref(CFDataCreateWithBytesNoCopy(
-        kCFAllocatorDefault, digest, base::checked_cast<CFIndex>(digest_len),
-        kCFAllocatorNull));
-
-    base::ScopedCFTypeRef<CFErrorRef> error;
-    base::ScopedCFTypeRef<CFDataRef> signature_ref(SecKeyCreateSignature(
-        key_, sec_algorithm, digest_ref, error.InitializeInto()));
-    if (!signature_ref) {
-      LOG(ERROR) << error;
-      return ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED;
-    }
-
-    signature->assign(
-        CFDataGetBytePtr(signature_ref),
-        CFDataGetBytePtr(signature_ref) + CFDataGetLength(signature_ref));
-    return OK;
-  }
-
- private:
-  std::vector<uint16_t> preferences_;
-  base::ScopedCFTypeRef<SecKeyRef> key_;
-
-  DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeySecKey);
-};
-
 scoped_refptr<SSLPrivateKey> CreateSSLPrivateKeyForSecKey(
     const X509Certificate* certificate,
     SecKeyRef private_key) {
@@ -298,13 +180,6 @@ scoped_refptr<SSLPrivateKey> CreateSSLPrivateKeyForSecKey(
   if (!GetClientCertInfo(certificate, &key_type, &max_length))
     return nullptr;
 
-  if (base::mac::IsAtLeastOS10_12()) {
-    return base::MakeRefCounted<ThreadedSSLPrivateKey>(
-        std::make_unique<SSLPlatformKeySecKey>(key_type, max_length,
-                                               private_key),
-        GetSSLPlatformKeyTaskRunner());
-  }
-
   const CSSM_KEY* cssm_key;
   OSStatus status = SecKeyGetCSSMKey(private_key, &cssm_key);
   if (status != noErr) {