|
@@ -12,10 +12,7 @@ import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import javax.inject.Inject;
|
|
|
import javafx.application.Application;
|
|
|
-import javafx.beans.binding.Bindings;
|
|
|
import javafx.beans.binding.BooleanBinding;
|
|
|
-import javafx.beans.binding.ObjectBinding;
|
|
|
-import javafx.beans.binding.StringBinding;
|
|
|
import javafx.beans.property.ObjectProperty;
|
|
|
import javafx.beans.property.SimpleObjectProperty;
|
|
|
import javafx.concurrent.WorkerStateEvent;
|
|
@@ -23,7 +20,6 @@ import javafx.fxml.FXML;
|
|
|
import javafx.stage.Stage;
|
|
|
import javafx.stage.WindowEvent;
|
|
|
import java.net.URI;
|
|
|
-import java.net.URISyntaxException;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.security.KeyPair;
|
|
@@ -40,6 +36,7 @@ public class AuthController implements FxController {
|
|
|
private final ExecutorService executor;
|
|
|
private final Stage window;
|
|
|
private final KeyPair keyPair;
|
|
|
+ private final AtomicReference<EciesParams> authParamsRef;
|
|
|
private final UserInteractionLock<HubKeyLoadingModule.AuthFlow> authFlowLock;
|
|
|
private final AtomicReference<URI> hubUriRef;
|
|
|
private final ErrorComponent.Builder errorComponent;
|
|
@@ -48,11 +45,12 @@ public class AuthController implements FxController {
|
|
|
private final AuthReceiveTask receiveTask;
|
|
|
|
|
|
@Inject
|
|
|
- public AuthController(Application application, ExecutorService executor, @KeyLoading Stage window, AtomicReference<KeyPair> keyPairRef, UserInteractionLock<HubKeyLoadingModule.AuthFlow> authFlowLock, AtomicReference<URI> hubUriRef, ErrorComponent.Builder errorComponent) {
|
|
|
+ public AuthController(Application application, ExecutorService executor, @KeyLoading Stage window, AtomicReference<KeyPair> keyPairRef, AtomicReference<EciesParams> authParamsRef, UserInteractionLock<HubKeyLoadingModule.AuthFlow> authFlowLock, AtomicReference<URI> hubUriRef, ErrorComponent.Builder errorComponent) {
|
|
|
this.application = application;
|
|
|
this.executor = executor;
|
|
|
this.window = window;
|
|
|
this.keyPair = Objects.requireNonNull(keyPairRef.get());
|
|
|
+ this.authParamsRef = authParamsRef;
|
|
|
this.authFlowLock = authFlowLock;
|
|
|
this.hubUriRef = hubUriRef;
|
|
|
this.errorComponent = errorComponent;
|
|
@@ -77,9 +75,7 @@ public class AuthController implements FxController {
|
|
|
}
|
|
|
|
|
|
private void receivedKey(WorkerStateEvent workerStateEvent) {
|
|
|
- var authParams = receiveTask.getValue();
|
|
|
- LOG.info("Cryptomator Hub login succeeded: {} encrypted with {}", authParams.getEphemeralPublicKey(), keyPair.getPublic());
|
|
|
- // TODO decrypt and return masterkey
|
|
|
+ authParamsRef.set(Objects.requireNonNull(receiveTask.getValue()));
|
|
|
authFlowLock.interacted(HubKeyLoadingModule.AuthFlow.SUCCESS);
|
|
|
window.close();
|
|
|
}
|