File tree Expand file tree Collapse file tree
apps/encryption/lib/Users Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010use OCA \Encryption \Crypto \Crypt ;
1111use OCA \Encryption \KeyManager ;
12+ use OCP \ICache ;
13+ use OCP \ICacheFactory ;
1214
1315class Setup {
16+ private readonly ICache $ cache ;
1417
1518 public function __construct (
1619 private Crypt $ crypt ,
1720 private KeyManager $ keyManager ,
21+ ICacheFactory $ cacheFactory ,
1822 ) {
23+ $ this ->cache = $ cacheFactory ->createLocal ('encryption-setup ' );
1924 }
2025
2126 /**
@@ -35,7 +40,10 @@ public function setupUser($uid, $password) {
3540 * make sure that all system keys exists
3641 */
3742 public function setupSystem () {
38- $ this ->keyManager ->validateShareKey ();
39- $ this ->keyManager ->validateMasterKey ();
43+ if (!$ this ->cache ->get ('keys-validated ' )) {
44+ $ this ->keyManager ->validateShareKey ();
45+ $ this ->keyManager ->validateMasterKey ();
46+ $ this ->cache ->set ('keys-validated ' , true );
47+ }
4048 }
4149}
You can’t perform that action at this time.
0 commit comments