@@ -3175,8 +3175,6 @@ BrowserGlue.prototype = {
3175
3175
function reportInstallationTelemetry ( ) {
3176
3176
lazy . BrowserUsageTelemetry . reportInstallationTelemetry ( ) ;
3177
3177
} ,
3178
-
3179
- RunOSKeyStoreSelfTest ,
3180
3178
] ;
3181
3179
3182
3180
for ( let task of idleTasks ) {
@@ -6450,70 +6448,3 @@ export var AboutHomeStartupCache = {
6450
6448
this . _cacheEntryResolver ( this . _cacheEntry ) ;
6451
6449
} ,
6452
6450
} ;
6453
-
6454
- async function RunOSKeyStoreSelfTest ( ) {
6455
- // The linux implementation always causes an OS dialog, in contrast to
6456
- // Windows and macOS (the latter of which causes an OS dialog to appear on
6457
- // local developer builds), so only run on Windows and macOS and only if this
6458
- // has been built and signed by Mozilla's infrastructure. Similarly, don't
6459
- // run this code in automation.
6460
- if (
6461
- ( AppConstants . platform != "win" && AppConstants . platform != "macosx" ) ||
6462
- ! AppConstants . MOZILLA_OFFICIAL ||
6463
- Services . env . get ( "MOZ_AUTOMATION" )
6464
- ) {
6465
- return ;
6466
- }
6467
- let osKeyStore = Cc [ "@mozilla.org/security/oskeystore;1" ] . getService (
6468
- Ci . nsIOSKeyStore
6469
- ) ;
6470
- let label = Services . prefs . getCharPref ( "security.oskeystore.test.label" , "" ) ;
6471
- if ( ! label ) {
6472
- label = Services . uuid . generateUUID ( ) . toString ( ) . slice ( 1 , - 1 ) ;
6473
- Services . prefs . setCharPref ( "security.oskeystore.test.label" , label ) ;
6474
- try {
6475
- await osKeyStore . asyncGenerateSecret ( label ) ;
6476
- Glean . oskeystore . selfTest . generate . set ( true ) ;
6477
- } catch ( _ ) {
6478
- Glean . oskeystore . selfTest . generate . set ( false ) ;
6479
- return ;
6480
- }
6481
- }
6482
- let secretAvailable = await osKeyStore . asyncSecretAvailable ( label ) ;
6483
- Glean . oskeystore . selfTest . available . set ( secretAvailable ) ;
6484
- if ( ! secretAvailable ) {
6485
- return ;
6486
- }
6487
- let encrypted = Services . prefs . getCharPref (
6488
- "security.oskeystore.test.encrypted" ,
6489
- ""
6490
- ) ;
6491
- if ( ! encrypted ) {
6492
- try {
6493
- encrypted = await osKeyStore . asyncEncryptBytes ( label , [ 1 , 1 , 3 , 8 ] ) ;
6494
- Services . prefs . setCharPref (
6495
- "security.oskeystore.test.encrypted" ,
6496
- encrypted
6497
- ) ;
6498
- Glean . oskeystore . selfTest . encrypt . set ( true ) ;
6499
- } catch ( _ ) {
6500
- Glean . oskeystore . selfTest . encrypt . set ( false ) ;
6501
- return ;
6502
- }
6503
- }
6504
- try {
6505
- let decrypted = await osKeyStore . asyncDecryptBytes ( label , encrypted ) ;
6506
- if (
6507
- decrypted . length != 4 ||
6508
- decrypted [ 0 ] != 1 ||
6509
- decrypted [ 1 ] != 1 ||
6510
- decrypted [ 2 ] != 3 ||
6511
- decrypted [ 3 ] != 8
6512
- ) {
6513
- throw new Error ( "decrypted value not as expected?" ) ;
6514
- }
6515
- Glean . oskeystore . selfTest . decrypt . set ( true ) ;
6516
- } catch ( _ ) {
6517
- Glean . oskeystore . selfTest . decrypt . set ( false ) ;
6518
- }
6519
- }
0 commit comments