@@ -25,12 +25,14 @@ export class EncryptionMainService implements IEncryptionMainService {
25
25
) {
26
26
// if this commandLine switch is set, the user has opted in to using basic text encryption
27
27
if ( app . commandLine . getSwitchValue ( 'password-store' ) === PasswordStoreCLIOption . basic ) {
28
+ this . logService . trace ( '[EncryptionMainService] setting usePlainTextEncryption to true...' ) ;
28
29
safeStorage . setUsePlainTextEncryption ?.( true ) ;
30
+ this . logService . trace ( '[EncryptionMainService] set usePlainTextEncryption to true' ) ;
29
31
}
30
32
}
31
33
32
34
async encrypt ( value : string ) : Promise < string > {
33
- this . logService . trace ( '[EncryptionMainService] Encrypting value.' ) ;
35
+ this . logService . trace ( '[EncryptionMainService] Encrypting value... ' ) ;
34
36
try {
35
37
const result = JSON . stringify ( safeStorage . encryptString ( value ) ) ;
36
38
this . logService . trace ( '[EncryptionMainService] Encrypted value.' ) ;
@@ -50,7 +52,7 @@ export class EncryptionMainService implements IEncryptionMainService {
50
52
}
51
53
const bufferToDecrypt = Buffer . from ( parsedValue . data ) ;
52
54
53
- this . logService . trace ( '[EncryptionMainService] Decrypting value.' ) ;
55
+ this . logService . trace ( '[EncryptionMainService] Decrypting value... ' ) ;
54
56
const result = safeStorage . decryptString ( bufferToDecrypt ) ;
55
57
this . logService . trace ( '[EncryptionMainService] Decrypted value.' ) ;
56
58
return result ;
@@ -61,7 +63,10 @@ export class EncryptionMainService implements IEncryptionMainService {
61
63
}
62
64
63
65
isEncryptionAvailable ( ) : Promise < boolean > {
64
- return Promise . resolve ( safeStorage . isEncryptionAvailable ( ) ) ;
66
+ this . logService . trace ( '[EncryptionMainService] Checking if encryption is available...' ) ;
67
+ const result = safeStorage . isEncryptionAvailable ( ) ;
68
+ this . logService . trace ( '[EncryptionMainService] Encryption is available: ' , result ) ;
69
+ return Promise . resolve ( result ) ;
65
70
}
66
71
67
72
getKeyStorageProvider ( ) : Promise < KnownStorageProvider > {
@@ -73,7 +78,9 @@ export class EncryptionMainService implements IEncryptionMainService {
73
78
}
74
79
if ( safeStorage . getSelectedStorageBackend ) {
75
80
try {
81
+ this . logService . trace ( '[EncryptionMainService] Getting selected storage backend...' ) ;
76
82
const result = safeStorage . getSelectedStorageBackend ( ) as KnownStorageProvider ;
83
+ this . logService . trace ( '[EncryptionMainService] Selected storage backend: ' , result ) ;
77
84
return Promise . resolve ( result ) ;
78
85
} catch ( e ) {
79
86
this . logService . error ( e ) ;
@@ -95,6 +102,8 @@ export class EncryptionMainService implements IEncryptionMainService {
95
102
throw new Error ( 'Setting plain text encryption is not supported.' ) ;
96
103
}
97
104
105
+ this . logService . trace ( '[EncryptionMainService] Setting usePlainTextEncryption to true...' ) ;
98
106
safeStorage . setUsePlainTextEncryption ( true ) ;
107
+ this . logService . trace ( '[EncryptionMainService] Set usePlainTextEncryption to true' ) ;
99
108
}
100
109
}
0 commit comments