-
Notifications
You must be signed in to change notification settings - Fork 43
/
chromium.patch
1670 lines (1575 loc) · 68.4 KB
/
chromium.patch
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From be2c4cd91ac9cef6921c6b31ce3da9f473f67d43 Mon Sep 17 00:00:00 2001
From: Dmitrii Pichulin <deem@deem.ru>
Date: Wed, 31 May 2023 01:06:37 +0300
Subject: [PATCH] chromium GOSTSSL
---
chrome/BUILD.gn | 4 +-
chrome/app/app-Info.plist | 2 -
chrome/app/app-entitlements.plist | 8 ++
chrome/app/generated_resources.grd | 3 -
.../app/resources/generated_resources_ru.xtb | 2 +-
chrome/app/theme/chromium/BRANDING | 16 +--
.../native_process_launcher_posix.cc | 12 ++
chrome/browser/history/top_sites_factory.cc | 4 +-
chrome/browser/resources/new_tab_page/app.ts | 6 +-
.../browser/resources/new_tab_page/logo.html | 5 +-
chrome/browser/resources/new_tab_page/logo.ts | 2 +-
.../new_tab_page/realbox/realbox.html | 7 +
chrome/browser/search/search.cc | 2 +
chrome/browser/shell_integration_linux.cc | 2 +-
.../ui/startup/startup_browser_creator.cc | 4 +-
.../browser/ui/views/certificate_selector.cc | 20 ++-
.../views/toolbar/browser_app_menu_button.cc | 2 +-
.../ui/webui/whats_new/whats_new_util.cc | 2 +-
chrome/common/channel_info_posix.cc | 2 +-
chrome/common/chrome_constants.cc | 2 +-
.../chromium-browser/chromium-browser.info | 10 +-
.../installer/linux/rpm/chrome.spec.template | 4 +
.../app_shim/certificate_viewer.mm | 46 ++++++
components/search_engines/keyword_table.cc | 4 +
.../search_engines/prepopulated_engines.json | 12 +-
.../search_engines/search_terms_data.cc | 2 +-
.../search_engines/template_url_data_util.cc | 6 +-
.../template_url_prepopulate_data.cc | 8 +-
content/browser/storage_partition_impl.cc | 9 ++
content/browser/utility_process_host.cc | 4 +
content/common/user_agent.cc | 2 +-
net/base/net_error_list.h | 5 +
net/cert/cert_verify_proc.cc | 23 +++
net/cert/x509_cert_types.cc | 25 ++++
net/cert/x509_cert_types.h | 2 +
net/http/http_network_transaction.cc | 9 ++
net/socket/socket.h | 4 +
net/socket/ssl_client_socket.cc | 9 ++
net/socket/ssl_client_socket.h | 4 +
net/socket/ssl_client_socket_impl.cc | 135 ++++++++++++++++++
net/socket/ssl_client_socket_impl.h | 3 +
net/spdy/spdy_session.cc | 5 +
net/ssl/client_cert_store_mac.cc | 31 ++++
net/ssl/client_cert_store_nss.cc | 33 +++++
net/ssl/client_cert_store_win.cc | 32 +++++
net/ssl/openssl_ssl_util.cc | 4 +
net/ssl/ssl_cipher_suite_names.cc | 64 +++++++++
net/ssl/ssl_platform_key_util.cc | 22 +++
net/ssl/ssl_platform_key_util.h | 7 +
sandbox/policy/features.cc | 4 +-
sandbox/policy/mac/common.sb | 16 +++
sandbox/win/src/process_mitigations.cc | 4 +
.../renderer/core/frame/reporting_context.cc | 8 ++
.../renderer/core/frame/reporting_context.h | 5 +
third_party/boringssl/BUILD.generated.gni | 2 +
55 files changed, 616 insertions(+), 54 deletions(-)
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 38b1cdc80c9ed..a9e20610e3564 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1553,7 +1553,7 @@ group("extra_resources") {
]
}
-if (is_chrome_branded && !is_android) {
+if (true && !is_android) {
if (!is_mac) {
_preinstalled_apps_target_type = "copy"
} else {
@@ -1597,7 +1597,7 @@ if (!is_android) {
deps = [ ":resource_allowlist" ]
}
- if (is_chrome_branded && !is_mac) {
+ if (true) {
public_deps = [ ":preinstalled_apps" ]
}
diff --git a/chrome/app/app-Info.plist b/chrome/app/app-Info.plist
index ff644f12dd89f..a76aace9f8248 100644
--- a/chrome/app/app-Info.plist
+++ b/chrome/app/app-Info.plist
@@ -241,8 +241,6 @@
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>${CHROMIUM_MIN_SYSTEM_VERSION}</string>
- <key>LSRequiresNativeExecution</key>
- <true/>
<key>NSPrincipalClass</key>
<string>BrowserCrApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
diff --git a/chrome/app/app-entitlements.plist b/chrome/app/app-entitlements.plist
index 5223754108237..177064aa6ecf7 100644
--- a/chrome/app/app-entitlements.plist
+++ b/chrome/app/app-entitlements.plist
@@ -14,5 +14,13 @@
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
+ <key>com.apple.security.smartcard</key>
+ <true/>
+ <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
+ <true/>
+ <key>com.apple.security.cs.disable-library-validation</key>
+ <true/>
+ <key>com.apple.security.cs.allow-jit</key>
+ <true/>
</dict>
</plist>
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 1632fdfac5b94..a102f6c2a8ff8 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -6782,13 +6782,10 @@ Keep your key file in a safe place. You will need it to create new versions of y
<!-- NTP -->
<message name="IDS_GOOGLE_SEARCH_BOX_EMPTY_HINT" desc="The text displayed in the fakebox (on the New Tab page) when it is empty, and Google is the default search engine.">
- Search Google or type URL
</message>
<message name="IDS_GOOGLE_SEARCH_BOX_EMPTY_HINT_MD" desc="The text displayed in the fakebox (on the New Tab page) when it is empty, Google is the default search engine, and the Material Design UI is enabled.">
- Search Google or type a URL
</message>
<message name="IDS_GOOGLE_SEARCH_BOX_EMPTY_HINT_SHORT" desc="The text displayed in the fakebox (on the New Tab page) when it is empty, Google is the default search engine, and short hint text is enabled.">
- Search Google
</message>
<message name="IDS_NTP_CUSTOM_LINKS_ADD_SHORTCUT_TOOLTIP" desc="The tooltip for adding a custom link shortcut. (On the New Tab Page)">
Add shortcut
diff --git a/chrome/app/resources/generated_resources_ru.xtb b/chrome/app/resources/generated_resources_ru.xtb
index ea76f48277213..641b1e75db23d 100644
--- a/chrome/app/resources/generated_resources_ru.xtb
+++ b/chrome/app/resources/generated_resources_ru.xtb
@@ -4794,7 +4794,7 @@
<translation id="5153234146675181447">Удаление телефона</translation>
<translation id="5153907427821264830"><ph name="STATUS" /> • <ph name="MESSAGE" /></translation>
<translation id="5154108062446123722"><ph name="PRINTING_DESTINATION" /> – дополнительные настройки</translation>
-<translation id="5154702632169343078">Тема</translation>
+<translation id="5154702632169343078">Субъект</translation>
<translation id="5155327081870541046">В адресной строке введите быструю команду для сайта, на котором нужно выполнить поиск, например @bookmarks. Затем нажмите нужное сочетание клавиш и добавьте поисковый запрос.</translation>
<translation id="5156638757840305347">Выделять текстовый курсор, когда он движется или появляется</translation>
<translation id="5157635116769074044">Прикрепить эту страницу к экрану запуска…</translation>
diff --git a/chrome/app/theme/chromium/BRANDING b/chrome/app/theme/chromium/BRANDING
index f8363d5b294fe..2f8021eabe810 100644
--- a/chrome/app/theme/chromium/BRANDING
+++ b/chrome/app/theme/chromium/BRANDING
@@ -1,10 +1,10 @@
-COMPANY_FULLNAME=The Chromium Authors
-COMPANY_SHORTNAME=The Chromium Authors
-PRODUCT_FULLNAME=Chromium
-PRODUCT_SHORTNAME=Chromium
-PRODUCT_INSTALLER_FULLNAME=Chromium Installer
-PRODUCT_INSTALLER_SHORTNAME=Chromium Installer
-COPYRIGHT=Copyright @LASTCHANGE_YEAR@ The Chromium Authors. All rights reserved.
-MAC_BUNDLE_ID=org.chromium.Chromium
+COMPANY_FULLNAME=The Chromium-Gost Authors
+COMPANY_SHORTNAME=The Chromium-Gost Authors
+PRODUCT_FULLNAME=Chromium-Gost
+PRODUCT_SHORTNAME=Chromium-Gost
+PRODUCT_INSTALLER_FULLNAME=Chromium-Gost Installer
+PRODUCT_INSTALLER_SHORTNAME=Chromium-Gost Installer
+COPYRIGHT=Copyright @LASTCHANGE_YEAR@ The Chromium-Gost Authors. All rights reserved.
+MAC_BUNDLE_ID=ru.cryptopro.chromium-gost
MAC_CREATOR_CODE=Cr24
MAC_TEAM_ID=
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
index f1a064bd2e8c5..c26cff6a17966 100644
--- a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
+++ b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
@@ -43,6 +43,18 @@ base::FilePath NativeProcessLauncher::FindManifest(
result = FindManifestInDir(chrome::DIR_USER_NATIVE_MESSAGING, host_name);
if (result.empty())
result = FindManifestInDir(chrome::DIR_NATIVE_MESSAGING, host_name);
+#ifndef NO_GOSTSSL
+ if (result.empty()) {
+#if defined(__APPLE__)
+ base::FilePath base_path = base::FilePath(FILE_PATH_LITERAL("/Library/Google/Chrome/NativeMessagingHosts"));
+#else
+ base::FilePath base_path = base::FilePath(FILE_PATH_LITERAL("/etc/opt/chrome/native-messaging-hosts"));
+#endif
+ base::FilePath path = base_path.Append(host_name + ".json");
+ if (base::PathExists(path))
+ result = path;
+ }
+#endif // GOSTSSL
if (result.empty())
*error_message = "Can't find native messaging host " + host_name;
diff --git a/chrome/browser/history/top_sites_factory.cc b/chrome/browser/history/top_sites_factory.cc
index 9c6f028be9f1d..7151bec17ba4b 100644
--- a/chrome/browser/history/top_sites_factory.cc
+++ b/chrome/browser/history/top_sites_factory.cc
@@ -54,7 +54,7 @@ struct RawPrepopulatedPage {
// roughly match favicon).
};
-#if !BUILDFLAG(IS_ANDROID)
+#if !BUILDFLAG(IS_ANDROID) && 0 // no prepopulated
// Android does not use prepopulated pages.
const RawPrepopulatedPage kRawPrepopulatedPages[] = {
{
@@ -69,7 +69,7 @@ const RawPrepopulatedPage kRawPrepopulatedPages[] = {
void InitializePrepopulatedPageList(
Profile* profile,
history::PrepopulatedPageList* prepopulated_pages) {
-#if !BUILDFLAG(IS_ANDROID)
+#if !BUILDFLAG(IS_ANDROID) && 0 // no prepopulated
DCHECK(prepopulated_pages);
PrefService* pref_service = profile->GetPrefs();
bool hide_web_store_icon =
diff --git a/chrome/browser/resources/new_tab_page/app.ts b/chrome/browser/resources/new_tab_page/app.ts
index efdf61babde21..83db531f7d310 100644
--- a/chrome/browser/resources/new_tab_page/app.ts
+++ b/chrome/browser/resources/new_tab_page/app.ts
@@ -221,7 +221,7 @@ export class AppElement extends AppElementBase {
oneGoogleBarEnabled_: {
type: Boolean,
- value: () => loadTimeData.getBoolean('oneGoogleBarEnabled'),
+ value: false,
},
shortcutsEnabled_: {
@@ -247,12 +247,12 @@ export class AppElement extends AppElementBase {
middleSlotPromoEnabled_: {
type: Boolean,
- value: () => loadTimeData.getBoolean('middleSlotPromoEnabled'),
+ value: false,
},
modulesEnabled_: {
type: Boolean,
- value: () => loadTimeData.getBoolean('modulesEnabled'),
+ value: false,
},
modulesRedesignedEnabled_: {
diff --git a/chrome/browser/resources/new_tab_page/logo.html b/chrome/browser/resources/new_tab_page/logo.html
index f1bf028553046..1bc12e7588401 100644
--- a/chrome/browser/resources/new_tab_page/logo.html
+++ b/chrome/browser/resources/new_tab_page/logo.html
@@ -23,10 +23,7 @@
}
:host([single-colored]) #logo {
- -webkit-mask-image: url(./icons/google_logo.svg);
- -webkit-mask-repeat: no-repeat;
- -webkit-mask-size: 100%;
- background-color: var(--ntp-logo-color);
+ background-image: url(./icons/google_logo.svg);
}
:host(:not([single-colored])) #logo {
diff --git a/chrome/browser/resources/new_tab_page/logo.ts b/chrome/browser/resources/new_tab_page/logo.ts
index d62ba160bbcad..eb5fb4e60d915 100644
--- a/chrome/browser/resources/new_tab_page/logo.ts
+++ b/chrome/browser/resources/new_tab_page/logo.ts
@@ -75,7 +75,7 @@ export class LogoElement extends PolymerElement {
},
showDoodle_: {
- computed: 'computeShowDoodle_(doodle_, imageDoodle_)',
+ computed: false,
type: Boolean,
},
diff --git a/chrome/browser/resources/new_tab_page/realbox/realbox.html b/chrome/browser/resources/new_tab_page/realbox/realbox.html
index 5a1097db26dab..f62a79a846a29 100644
--- a/chrome/browser/resources/new_tab_page/realbox/realbox.html
+++ b/chrome/browser/resources/new_tab_page/realbox/realbox.html
@@ -1,4 +1,11 @@
<style include="cr-icons">
+ #voiceSearchButton {
+ visibility: hidden;
+ }
+ #lensSearchButton {
+ visibility: hidden;
+ }
+
:host {
--cr-realbox-height: 44px;
--cr-realbox-min-width: var(--ntp-search-box-width);
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index d367a6dee4e18..0ab7a639672d5 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -181,6 +181,8 @@ struct NewTabURLDetails {
#if BUILDFLAG(IS_ANDROID)
const GURL local_url;
+#elif 1 // Always use built-in NTp page
+ const GURL local_url(chrome::kChromeUINewTabPageURL);
#else
const GURL local_url(DefaultSearchProviderIsGoogle(profile)
? chrome::kChromeUINewTabPageURL
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index 032e9d2cf753b..3fca462a8da9f 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -504,7 +504,7 @@ std::string GetIconName() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
return "google-chrome";
#else // BUILDFLAG(CHROMIUM_BRANDING)
- return "chromium-browser";
+ return "chromium-gost";
#endif
}
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
index e5b4dfd0d3fe3..be80e7b933acd 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -907,12 +907,12 @@ void StartupBrowserCreator::ClearLaunchedProfilesForTesting() {
// static
void StartupBrowserCreator::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) {
- registry->RegisterBooleanPref(prefs::kPromotionalTabsEnabled, true);
+ registry->RegisterBooleanPref(prefs::kPromotionalTabsEnabled, false);
#if !BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(prefs::kCommandLineFlagSecurityWarningsEnabled,
true);
#endif
- registry->RegisterBooleanPref(prefs::kSuppressUnsupportedOSWarning, false);
+ registry->RegisterBooleanPref(prefs::kSuppressUnsupportedOSWarning, true);
registry->RegisterBooleanPref(prefs::kWasRestarted, false);
#if BUILDFLAG(IS_WIN)
diff --git a/chrome/browser/ui/views/certificate_selector.cc b/chrome/browser/ui/views/certificate_selector.cc
index 32f7a63a43f99..46cfd099c8879 100644
--- a/chrome/browser/ui/views/certificate_selector.cc
+++ b/chrome/browser/ui/views/certificate_selector.cc
@@ -40,8 +40,8 @@
namespace chrome {
-const int CertificateSelector::kTableViewWidth = 500;
-const int CertificateSelector::kTableViewHeight = 150;
+const int CertificateSelector::kTableViewWidth = 800;
+const int CertificateSelector::kTableViewHeight = 300;
class CertificateSelector::CertificateTableModel : public ui::TableModel {
public:
@@ -63,6 +63,7 @@ class CertificateSelector::CertificateTableModel : public ui::TableModel {
std::u16string issuer;
std::u16string provider;
std::u16string serial;
+ std::u16string validity;
};
std::vector<Row> rows_;
};
@@ -81,6 +82,15 @@ CertificateSelector::CertificateTableModel::CertificateTableModel(
row.serial = base::UTF8ToUTF16(base::HexEncode(
cert->serial_number().data(), cert->serial_number().size()));
}
+ base::Time::Exploded start_exploded, expiry_exploded;
+ cert->valid_start().UTCExplode(&start_exploded);
+ cert->valid_expiry().UTCExplode(&expiry_exploded);
+ std::string validity = base::StringPrintf(
+ "%04d.%02d.%02d - %04d.%02d.%02d",
+ start_exploded.year, start_exploded.month, start_exploded.day_of_month,
+ expiry_exploded.year, expiry_exploded.month, expiry_exploded.day_of_month
+ );
+ row.validity = base::UTF8ToUTF16(validity);
rows_.push_back(row);
}
}
@@ -104,6 +114,8 @@ std::u16string CertificateSelector::CertificateTableModel::GetText(
return row.provider;
case IDS_CERT_SELECTOR_SERIAL_COLUMN:
return row.serial;
+ case IDS_CERT_DETAILS_VALIDITY:
+ return row.validity;
default:
NOTREACHED_NORETURN();
}
@@ -216,14 +228,14 @@ void CertificateSelector::InitWithText(
std::vector<ui::TableColumn> columns;
columns.push_back(ui::TableColumn(IDS_CERT_SELECTOR_SUBJECT_COLUMN,
- ui::TableColumn::LEFT, -1, 0.4f));
+ ui::TableColumn::LEFT, -1, 0.8f));
columns.push_back(ui::TableColumn(IDS_CERT_SELECTOR_ISSUER_COLUMN,
ui::TableColumn::LEFT, -1, 0.2f));
if (show_provider_column_) {
columns.push_back(ui::TableColumn(IDS_CERT_SELECTOR_PROVIDER_COLUMN,
ui::TableColumn::LEFT, -1, 0.4f));
}
- columns.push_back(ui::TableColumn(IDS_CERT_SELECTOR_SERIAL_COLUMN,
+ columns.push_back(ui::TableColumn(IDS_CERT_DETAILS_VALIDITY,
ui::TableColumn::LEFT, -1, 0.2f));
for (auto& column : columns) {
column.sortable = true;
diff --git a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
index 64da8b20df1cf..356642b7c47a9 100644
--- a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
+++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
@@ -171,7 +171,7 @@ void BrowserAppMenuButton::UpdateTextAndHighlightColor() {
#endif
} else {
tooltip_message_id = IDS_APPMENU_TOOLTIP_ALERT;
- text = l10n_util::GetStringUTF16(IDS_APP_MENU_BUTTON_ERROR);
+ text = std::u16string(u"!");
}
absl::optional<SkColor> color;
diff --git a/chrome/browser/ui/webui/whats_new/whats_new_util.cc b/chrome/browser/ui/webui/whats_new/whats_new_util.cc
index 5fd003f886920..bde8e92abb07d 100644
--- a/chrome/browser/ui/webui/whats_new/whats_new_util.cc
+++ b/chrome/browser/ui/webui/whats_new/whats_new_util.cc
@@ -98,7 +98,7 @@ bool ShouldShowForState(PrefService* local_state,
// potentially displaying multiple times in a given milestone, e.g. for
// multiple profile relaunches (see https://crbug.com/1274313).
local_state->SetInteger(prefs::kLastWhatsNewVersion, CHROME_VERSION_MAJOR);
- return true;
+ return false;
}
GURL GetServerURL(bool may_redirect) {
diff --git a/chrome/common/channel_info_posix.cc b/chrome/common/channel_info_posix.cc
index 51e8bae89a41b..2fdcafa5c35f9 100644
--- a/chrome/common/channel_info_posix.cc
+++ b/chrome/common/channel_info_posix.cc
@@ -145,7 +145,7 @@ std::string GetDesktopName(base::Environment* env) {
std::string name;
if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty())
return name;
- return "chromium-browser.desktop";
+ return "chromium-gost.desktop";
#endif
}
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc
index 0edfaa40bb37e..10f7e5bdc1f9b 100644
--- a/chrome/common/chrome_constants.cc
+++ b/chrome/common/chrome_constants.cc
@@ -17,7 +17,7 @@
#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)
#define PRODUCT_STRING "Google Chrome for Testing"
#elif BUILDFLAG(CHROMIUM_BRANDING)
-#define PRODUCT_STRING "Chromium"
+#define PRODUCT_STRING "Chromium-Gost"
#else
#error Unknown branding
#endif
diff --git a/chrome/installer/linux/common/chromium-browser/chromium-browser.info b/chrome/installer/linux/common/chromium-browser/chromium-browser.info
index d49854144e115..4ecb9014e869a 100644
--- a/chrome/installer/linux/common/chromium-browser/chromium-browser.info
+++ b/chrome/installer/linux/common/chromium-browser/chromium-browser.info
@@ -6,7 +6,7 @@
# chromium-browser packages for various platforms.
# Base name of the package.
-PACKAGE="chromium-browser"
+PACKAGE="chromium-gost"
# Base name of the snap package
SNAPNAME="chromium"
@@ -15,19 +15,19 @@ SNAPNAME="chromium"
PROGNAME=chrome
# Base directory for package installation.
-INSTALLDIR=/opt/chromium.org/chromium
+INSTALLDIR=/opt/chromium-gost
# Directory for device policy enrollments.
ENROLLMENTDIR=/etc/chromium/policies/enrollment
# Display string for desktop menu/icon.
-MENUNAME="Chromium Web Browser"
+MENUNAME="Chromium-Gost"
# Brief package description.
-SHORTDESC="The web browser from Chromium.org"
+SHORTDESC="Chromium browser with GOST cryptography support"
# Detailed package description.
-FULLDESC="Chromium is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier."
+FULLDESC="Chromium is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. This version supports GOST cryptography in TLS-connections."
# Package maintainer information.
# TODO(mmoss) Setup a mailbox for this address
diff --git a/chrome/installer/linux/rpm/chrome.spec.template b/chrome/installer/linux/rpm/chrome.spec.template
index e968b5fd711d6..92edea048bd0f 100644
--- a/chrome/installer/linux/rpm/chrome.spec.template
+++ b/chrome/installer/linux/rpm/chrome.spec.template
@@ -124,6 +124,8 @@ add_nss_symlinks
remove_udev_symlinks
+if false; then
+
if [ ! -e "$DEFAULTS_FILE" ]; then
echo 'repo_add_once="true"' > "$DEFAULTS_FILE"
fi
@@ -146,6 +148,8 @@ if [ "$repo_add_once" = "true" ]; then
done
fi
+fi
+
CHANNEL=@@CHANNEL@@
case $CHANNEL in
stable )
diff --git a/components/remote_cocoa/app_shim/certificate_viewer.mm b/components/remote_cocoa/app_shim/certificate_viewer.mm
index d249482052790..523f3951f5c2e 100644
--- a/components/remote_cocoa/app_shim/certificate_viewer.mm
+++ b/components/remote_cocoa/app_shim/certificate_viewer.mm
@@ -13,10 +13,56 @@
#include "base/notreached.h"
#include "net/cert/x509_util_apple.h"
+#ifndef NO_GOSTSSL
+extern "C" {
+#include "third_party/boringssl/src/include/openssl/pool.h"
+void gostssl_isgostcerthook( void * cert, int size, int * is_gost );
+char gostssl_certificate_info( const char * cert, size_t size, const char ** info, size_t * len );
+}
+#endif // GOSTSSL
+
namespace remote_cocoa {
void ShowCertificateViewerForWindow(NSWindow* owning_window,
net::X509Certificate* certificate) {
+#ifndef NO_GOSTSSL
+ int is_gost = 0;
+ {
+ const uint8_t * gostcert = CRYPTO_BUFFER_data( certificate->cert_buffer() );
+ size_t gostcertlen = CRYPTO_BUFFER_len( certificate->cert_buffer() );
+ gostssl_isgostcerthook( (void *)gostcert, gostcertlen, &is_gost );
+ }
+
+ if( is_gost == 1 )
+ {
+ const char * info;
+ size_t infoLen;
+ NSAttributedString * certinfo;
+
+ const char * gostcert = (const char *)CRYPTO_BUFFER_data( certificate->cert_buffer() );
+ size_t gostcertlen = CRYPTO_BUFFER_len( certificate->cert_buffer() );
+ if( !gostssl_certificate_info( gostcert, gostcertlen, &info, &infoLen ) )
+ certinfo = [[NSAttributedString alloc] initWithString:@"(Не удалось получить информацию о сертификате)"];
+ else
+ certinfo = [[NSAttributedString alloc] initWithHTML:[NSData dataWithBytes:info length:infoLen] documentAttributes:nil];
+
+ return dispatch_async( dispatch_get_main_queue(), ^
+ {
+ NSAlert * alert = [[NSAlert alloc] init];
+ NSTextView * accessory = [[NSTextView alloc] initWithFrame:NSMakeRect( 0, 0, 600, 400 )];
+ [accessory insertText:certinfo replacementRange:NSMakeRange( 0, 0 )];
+ [accessory setEditable:NO];
+ [accessory setDrawsBackground:NO];
+ accessory.textColor = [NSColor controlTextColor];
+
+ [alert setMessageText:@"Информация о сертификате сайта"];
+ [alert setAccessoryView:accessory];
+ [alert setAlertStyle:NSAlertStyleInformational];
+ [alert beginSheetModalForWindow:owning_window completionHandler:nil];
+ } );
+ }
+#endif // GOSTSSL
+
base::ScopedCFTypeRef<CFArrayRef> cert_chain(
net::x509_util::CreateSecCertificateArrayForX509Certificate(certificate));
if (!cert_chain)
diff --git a/components/search_engines/keyword_table.cc b/components/search_engines/keyword_table.cc
index ad6afc9ee4308..d28ac27862930 100644
--- a/components/search_engines/keyword_table.cc
+++ b/components/search_engines/keyword_table.cc
@@ -166,7 +166,9 @@ void BindURLToStatement(const TemplateURLData& data,
s->BindString(starting_column + 16, data.search_url_post_params);
s->BindString(starting_column + 17, data.suggestions_url_post_params);
s->BindString(starting_column + 18, data.image_url_post_params);
+#if 0 // Disable new tab overriding by search engines
s->BindString(starting_column + 19, data.new_tab_url);
+#endif
s->BindTime(starting_column + 20, data.last_visited);
s->BindBool(starting_column + 21, data.created_from_play_api);
s->BindInt(starting_column + 22, static_cast<int>(data.is_active));
@@ -508,7 +510,9 @@ bool KeywordTable::GetKeywordDataFromStatement(sql::Statement& s,
data->SetURL(s.ColumnString(4));
data->suggestions_url = s.ColumnString(10);
data->image_url = s.ColumnString(16);
+#if 0 // Disable new tab overriding by search engines
data->new_tab_url = s.ColumnString(20);
+#endif
data->search_url_post_params = s.ColumnString(17);
data->suggestions_url_post_params = s.ColumnString(18);
data->image_url_post_params = s.ColumnString(19);
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
index cdfa06094cfcd..e672076a31b3b 100644
--- a/components/search_engines/prepopulated_engines.json
+++ b/components/search_engines/prepopulated_engines.json
@@ -556,7 +556,7 @@
"keyword": "yandex.by",
"favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
"logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png",
- "search_url": "https://yandex.by/{yandex:searchPath}?text={searchTerms}",
+ "search_url": "https://yandex.by/{yandex:searchPath}?text={searchTerms}&from=cr_gost&{yandex:referralID}",
"suggest_url": "https://suggest.yandex.by/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.by/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -569,7 +569,7 @@
"name": "Yandex",
"keyword": "yandex.com",
"favicon_url": "https://yastatic.net/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico",
- "search_url": "https://yandex.com/search/?text={searchTerms}&from=os&clid=1836588",
+ "search_url": "https://yandex.com/search/?text={searchTerms}&from=cr_gost&{yandex:referralID}",
"suggest_url": "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}&uil=en&v=3&sn=5",
"image_url": "https://yandex.com/images/search?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -582,7 +582,7 @@
"keyword": "yandex.kz",
"favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
"logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png",
- "search_url": "https://yandex.kz/{yandex:searchPath}?text={searchTerms}",
+ "search_url": "https://yandex.kz/{yandex:searchPath}?text={searchTerms}&from=cr_gost&{yandex:referralID}",
"suggest_url": "https://suggest.yandex.kz/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.kz/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -596,7 +596,7 @@
"keyword": "yandex.ru",
"favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
"logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png",
- "search_url": "https://yandex.ru/{yandex:searchPath}?text={searchTerms}&{yandex:referralID}",
+ "search_url": "https://yandex.ru/{yandex:searchPath}?text={searchTerms}&from=cr_gost&{yandex:referralID}",
"suggest_url": "https://suggest.yandex.ru/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.ru/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -609,7 +609,7 @@
"name": "Yandex",
"keyword": "yandex.com.tr",
"favicon_url": "https://yastatic.net/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico",
- "search_url": "https://www.yandex.com.tr/{yandex:searchPath}?text={searchTerms}",
+ "search_url": "https://www.yandex.com.tr/{yandex:searchPath}?text={searchTerms}&from=cr_gost&{yandex:referralID}",
"suggest_url": "https://suggest.yandex.com.tr/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.com.tr/gorsel/search?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -623,7 +623,7 @@
"keyword": "yandex.ua",
"favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
"logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png",
- "search_url": "https://yandex.ua/{yandex:searchPath}?text={searchTerms}",
+ "search_url": "https://yandex.ua/{yandex:searchPath}?text={searchTerms}&from=cr_gost&{yandex:referralID}",
"suggest_url": "https://suggest.yandex.ua/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.ua/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
diff --git a/components/search_engines/search_terms_data.cc b/components/search_engines/search_terms_data.cc
index 26c2e0f077f91..217af88830d25 100644
--- a/components/search_engines/search_terms_data.cc
+++ b/components/search_engines/search_terms_data.cc
@@ -165,7 +165,7 @@ std::string SearchTermsData::GoogleImageSearchSource() const {
}
std::string SearchTermsData::GetYandexReferralID() const {
- return std::string();
+ return "2766495";
}
std::string SearchTermsData::GetMailRUReferralID() const {
diff --git a/components/search_engines/template_url_data_util.cc b/components/search_engines/template_url_data_util.cc
index 82d054944af0e..13d2aa704e71e 100644
--- a/components/search_engines/template_url_data_util.cc
+++ b/components/search_engines/template_url_data_util.cc
@@ -71,10 +71,12 @@ std::unique_ptr<TemplateURLData> TemplateURLDataFromDictionary(
if (string_value) {
result->image_translate_url = *string_value;
}
+#if 0 // Disable new tab overriding by search engines
string_value = dict.FindString(DefaultSearchManager::kNewTabURL);
if (string_value) {
result->new_tab_url = *string_value;
}
+#endif
string_value = dict.FindString(DefaultSearchManager::kContextualSearchURL);
if (string_value) {
result->contextual_search_url = *string_value;
@@ -338,7 +340,7 @@ std::unique_ptr<TemplateURLData> TemplateURLDataFromPrepopulatedEngine(
ToStringPiece(engine.search_url), ToStringPiece(engine.suggest_url),
ToStringPiece(engine.image_url),
ToStringPiece(engine.image_translate_url),
- ToStringPiece(engine.new_tab_url),
+ base::StringPiece(), //ToStringPiece(engine.new_tab_url),
ToStringPiece(engine.contextual_search_url),
ToStringPiece(engine.logo_url), ToStringPiece(engine.doodle_url),
ToStringPiece(engine.search_url_post_params),
@@ -429,10 +431,12 @@ std::unique_ptr<TemplateURLData> TemplateURLDataFromOverrideDictionary(
if (string_value) {
image_translate_url = *string_value;
}
+#if 0 // Disable new tab overriding by search engines
string_value = engine_dict.FindString("new_tab_url");
if (string_value) {
new_tab_url = *string_value;
}
+#endif
string_value = engine_dict.FindString("contextual_search_url");
if (string_value) {
contextual_search_url = *string_value;
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
index fb459bc4dfedb..efaa4b294d0b3 100644
--- a/components/search_engines/template_url_prepopulate_data.cc
+++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -1331,6 +1331,12 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulationSetFromCountryID(
std::vector<std::unique_ptr<TemplateURLData>> t_urls;
for (size_t i = 0; i < num_engines; ++i)
t_urls.push_back(TemplateURLDataFromPrepopulatedEngine(*engines[i]));
+
+ const auto itr =
+ base::ranges::find(t_urls, yandex_ru.id, &TemplateURLData::prepopulate_id);
+ if (itr == t_urls.end()) {
+ t_urls.push_back(TemplateURLDataFromPrepopulatedEngine(yandex_com));
+ }
return t_urls;
}
@@ -1384,7 +1390,7 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines(
}
if (default_search_provider_index) {
const auto itr =
- base::ranges::find(t_urls, google.id, &TemplateURLData::prepopulate_id);
+ base::ranges::find(t_urls, yandex_ru.id, &TemplateURLData::prepopulate_id);
*default_search_provider_index =
itr == t_urls.end() ? 0 : std::distance(t_urls.begin(), itr);
}
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
index ec5b4bff492cd..d5226f8f62be8 100644
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -151,6 +151,10 @@
#include "services/service_manager/public/cpp/interface_provider.h"
#endif // BUILDFLAG(IS_ANDROID)
+#ifndef NO_GOSTSSL
+#include "net/ssl/ssl_platform_key_util.h"
+#endif // GOSTSSL
+
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
#include "content/browser/media/media_license_manager.h"
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
@@ -617,6 +621,11 @@ class SSLClientAuthDelegate : public SSLClientAuthHandler::Delegate {
scoped_refptr<net::X509Certificate> cert,
scoped_refptr<net::SSLPrivateKey> private_key) override {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+#ifndef NO_GOSTSSL
+ if (cert && !private_key) {
+ private_key = net::GetEmptyPrivateKey();
+ }
+#endif // GOSTSSL
DCHECK((cert && private_key) || (!cert && !private_key));
if (cert && private_key) {
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index 475614df3115a..c21cc3c9f2ab0 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -296,6 +296,10 @@ bool UtilityProcessHost::StartProcess() {
// Browser command-line switches to propagate to the utility process.
static const char* const kSwitchNames[] = {
+#ifndef NO_GOSTSSL
+ "ciphers",
+ "tlsmode",
+#endif // GOSTSSL
network::switches::kAdditionalTrustTokenKeyCommitments,
network::switches::kForceEffectiveConnectionType,
network::switches::kHostResolverRules,
diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
index 5c99971335e9c..e69eccd614d64 100644
--- a/content/common/user_agent.cc
+++ b/content/common/user_agent.cc
@@ -406,7 +406,7 @@ std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
// compatible with Safari, we hope!!
std::string user_agent;
base::StringAppendF(&user_agent,
- "Mozilla/5.0 (%s) AppleWebKit/537.36 (KHTML, like Gecko) "
+ "Mozilla/5.0 (%s; Chromium GOST) AppleWebKit/537.36 (KHTML, like Gecko) "
"%s Safari/537.36",
os_info.c_str(), product.c_str());
return user_agent;
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h
index 951a5f93cc6e6..79662d8ef8c6a 100644
--- a/net/base/net_error_list.h
+++ b/net/base/net_error_list.h
@@ -22,6 +22,11 @@
// 700-799 Certificate manager errors
// 800-899 DNS resolver errors
+#ifndef NO_GOSTSSL
+// 3000-3099 GOSTSSL
+NET_ERROR(TLS_GOST_REQUIRED, -3072)
+#endif // GOSTSSL
+
// An asynchronous IO operation is not yet complete. This usually does not
// indicate a fatal error. Typically this error will be generated as a
// notification to wait for some external notification that the IO operation
diff --git a/net/cert/cert_verify_proc.cc b/net/cert/cert_verify_proc.cc
index 4e84c53c716d4..b8f749c9ca324 100644
--- a/net/cert/cert_verify_proc.cc
+++ b/net/cert/cert_verify_proc.cc
@@ -457,6 +457,12 @@ CertVerifyProc::CertVerifyProc(scoped_refptr<CRLSet> crl_set)
CHECK(crl_set_);
}
+#ifndef NO_GOSTSSL
+extern "C" {
+void gostssl_isgostcerthook( void * cert, int size, int * is_gost );
+}
+#endif // GOSTSSL
+
CertVerifyProc::~CertVerifyProc() = default;
int CertVerifyProc::Verify(X509Certificate* cert,
@@ -486,6 +492,23 @@ int CertVerifyProc::Verify(X509Certificate* cert,
int rv = VerifyInternal(cert, hostname, ocsp_response, sct_list, flags,
additional_trust_anchors, verify_result, net_log);
+#ifndef NO_GOSTSSL
+ int is_gost = 0;
+ {
+ {
+ const uint8_t * gostcert = CRYPTO_BUFFER_data( cert->cert_buffer() );
+ size_t gostcertlen = CRYPTO_BUFFER_len( cert->cert_buffer() );
+ gostssl_isgostcerthook( (void *)gostcert, gostcertlen, &is_gost );
+ }
+ }
+
+ if( is_gost == 1 )
+ {
+ // TODO: we can check for weak GOST algos
+ }
+ else
+#endif // GOSTSSL
+
// Check for mismatched signature algorithms and unknown signature algorithms
// in the chain. Also fills in the has_* booleans for the digest algorithms
// present in the chain.
diff --git a/net/cert/x509_cert_types.cc b/net/cert/x509_cert_types.cc
index e2d6c8ace679f..397a128eb776f 100644
--- a/net/cert/x509_cert_types.cc
+++ b/net/cert/x509_cert_types.cc
@@ -35,6 +35,18 @@ bool CertPrincipal::ParseDistinguishedName(
&common_name)) {
return false;
}
+ } else if (name_attribute.type == der::Input(kTypeSurnameOid)) {
+ if (sur_name.empty() &&
+ !name_attribute.ValueAsStringWithUnsafeOptions(string_handling,
+ &sur_name)) {
+ return false;
+ }
+ } else if (name_attribute.type == der::Input(kTypeGivenNameOid)) {
+ if (given_name.empty() &&
+ !name_attribute.ValueAsStringWithUnsafeOptions(string_handling,
+ &given_name)) {
+ return false;
+ }
} else if (name_attribute.type == der::Input(kTypeLocalityNameOid)) {
if (locality_name.empty() &&
!name_attribute.ValueAsStringWithUnsafeOptions(string_handling,
@@ -83,7 +95,20 @@ bool CertPrincipal::ParseDistinguishedName(
std::string CertPrincipal::GetDisplayName() const {
if (!common_name.empty())
+ {
+ if (!organization_names.empty())
+ {
+ std::string name = common_name;
+ std::string organization_name = organization_names[0];
+ if (common_name == organization_name)
+ if (!sur_name.empty() && !given_name.empty())
+ name = sur_name + " " + given_name + " (ЮЛ)";
+ return name + " (" + organization_name + ")";
+ }
+ if (!organization_unit_names.empty())
+ return common_name + " (" + organization_unit_names[0] + ")";
return common_name;
+ }
if (!organization_names.empty())
return organization_names[0];
if (!organization_unit_names.empty())
diff --git a/net/cert/x509_cert_types.h b/net/cert/x509_cert_types.h
index 2dd6d3c9567f2..5b33d9b3611e9 100644
--- a/net/cert/x509_cert_types.h
+++ b/net/cert/x509_cert_types.h
@@ -38,6 +38,8 @@ struct NET_EXPORT CertPrincipal {
// Note that some of them can have several values.
std::string common_name;
+ std::string sur_name;
+ std::string given_name;
std::string locality_name;
std::string state_or_province_name;
std::string country_name;
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index d8bade0a8fd54..64499ea6d9d44 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -1593,6 +1593,15 @@ int HttpNetworkTransaction::HandleSSLClientAuthError(int error) {
}
}
}
+
+#ifndef NO_GOSTSSL
+ if( error == ERR_TLS_GOST_REQUIRED )
+ {
+ ResetConnectionAndRequestForResend(RetryReason::kWrongVersionOnEarlyData);
+ return OK;
+ }
+#endif // GOSTSSL
+
return error;
}
diff --git a/net/socket/socket.h b/net/socket/socket.h
index 64e08182d6647..c52bc4bfb349e 100644
--- a/net/socket/socket.h
+++ b/net/socket/socket.h
@@ -21,6 +21,10 @@ class IOBuffer;
// Represents a read/write socket.
class NET_EXPORT Socket {
public:
+#ifndef NO_GOSTSSL
+ virtual int IsMSSPI() { return 0; }
+#endif // GOSTSSL
+
Socket();
virtual ~Socket();
diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc
index 4dd73b5c3c5cd..e3fd5e5dd9957 100644
--- a/net/socket/ssl_client_socket.cc
+++ b/net/socket/ssl_client_socket.cc
@@ -13,6 +13,10 @@
#include "net/ssl/ssl_client_session_cache.h"
#include "net/ssl/ssl_key_logger.h"
+#ifndef NO_GOSTSSL
+#include "base/atomic_sequence_num.h"
+#endif /* NO_GOSTSSL */
+
namespace net {
SSLClientSocket::SSLClientSocket() = default;
@@ -68,6 +72,11 @@ SSLClientContext::SSLClientContext(
}
cert_verifier_->AddObserver(this);
CertDatabase::GetInstance()->AddObserver(this);
+
+#ifndef NO_GOSTSSL
+ static base::AtomicSequenceNumber g_seqnum;
+ seqnum_ = g_seqnum.GetNext();
+#endif /* NO_GOSTSSL */
}
SSLClientContext::~SSLClientContext() {
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h
index ddbbf708c3685..25b6a297b5fbf 100644
--- a/net/socket/ssl_client_socket.h
+++ b/net/socket/ssl_client_socket.h
@@ -194,6 +194,10 @@ class NET_EXPORT SSLClientContext : public SSLConfigService::Observer,
// CertDatabase::Observer:
void OnCertDBChanged() override;
+#ifndef NO_GOSTSSL
+ int seqnum_;
+#endif /* NO_GOSTSSL */
+
private:
void NotifySSLConfigChanged(SSLConfigChangeType change_type);
void NotifySSLConfigForServerChanged(const HostPortPair& server);
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
index 31256e7910adf..7e6da90c52275 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -417,6 +417,18 @@ int SSLClientSocketImpl::ExportKeyingMaterial(base::StringPiece label,
return OK;
}
+#ifndef NO_GOSTSSL
+extern "C" {
+void gostssl_newsession( SSL * s, const void * cachestring, size_t len, const void * cert, int size, const char * ciphers, const char * tlsmode );
+void gostssl_certhook( void * cert, int size );
+void gostssl_verifyhook( void * s, const char * host, unsigned * is_gost );
+int gostssl_is_msspi( SSL * s );
+}
+int SSLClientSocketImpl::IsMSSPI() {
+ return gostssl_is_msspi( ssl_.get() );
+}
+#endif // GOSTSSL
+
int SSLClientSocketImpl::Connect(CompletionOnceCallback callback) {
// Although StreamSocket does allow calling Connect() after Disconnect(),
// this has never worked for layered sockets. CHECK to detect any consumers
@@ -435,6 +447,41 @@ int SSLClientSocketImpl::Connect(CompletionOnceCallback callback) {