From 1676e0dd5c8484b12afa13e74b6f23878f76c305 Mon Sep 17 00:00:00 2001 From: Javier Guerra Melgares Date: Thu, 24 Oct 2019 14:56:52 +0200 Subject: [PATCH 1/3] Update End-Entity certificate --- src/main/resources/data/kyrio-ee-cert.pem | 18 +++++++++--------- src/main/resources/data/kyrio-ee-key.pem | 9 ++++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/main/resources/data/kyrio-ee-cert.pem b/src/main/resources/data/kyrio-ee-cert.pem index 6ab9a5d..3ee52a3 100644 --- a/src/main/resources/data/kyrio-ee-cert.pem +++ b/src/main/resources/data/kyrio-ee-cert.pem @@ -1,14 +1,14 @@ -----BEGIN CERTIFICATE----- -MIIEEzCCA7mgAwIBAgIJAI0K+3tTskzXMAoGCCqGSM49BAMCMFsxDDAKBgNVBAoM +MIIEEzCCA7mgAwIBAgIJAI0K+3tTsk0AMAoGCCqGSM49BAMCMFsxDDAKBgNVBAoM A09DRjEiMCAGA1UECwwZS3lyaW8gVGVzdCBJbmZyYXN0cnVjdHVyZTEnMCUGA1UE -AwweS3lyaW8gVEVTVCBJbnRlcm1lZGlhdGUgQ0EwMDAyMB4XDTE5MDkyMzA5MjUx -OFoXDTE5MTAyMzA5MjUxOFowYTEMMAoGA1UECgwDT0NGMSIwIAYDVQQLDBlLeXJp +AwweS3lyaW8gVEVTVCBJbnRlcm1lZGlhdGUgQ0EwMDAyMB4XDTE5MTAyNDA5NDg1 +NFoXDTE5MTEyMzA5NDg1NFowYTEMMAoGA1UECgwDT0NGMSIwIAYDVQQLDBlLeXJp byBUZXN0IEluZnJhc3RydWN0dXJlMS0wKwYDVQQDDCQxZTFiZWJmYi04ZjAzLTQ3 -ODUtNWZhNy0xYjcwNGU2NTQzNjAwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQj -V7MJwkO4J4PWR4KgbVHrFHSQipHMRNu704OPmnAQQ3tnEhjnYxn0TODDvN8YekE5 -voDDOX98mYpxhPa5hz52o4ICXjCCAlow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RKjCDaGGZi +mHTurqYCIC/e7Y9NAMiweZZ2JaGAYXC7T8YTqAFneT9jaq2o3c9m -----END CERTIFICATE----- diff --git a/src/main/resources/data/kyrio-ee-key.pem b/src/main/resources/data/kyrio-ee-key.pem index 74373c9..eb4fad6 100644 --- a/src/main/resources/data/kyrio-ee-key.pem +++ b/src/main/resources/data/kyrio-ee-key.pem @@ -1,5 +1,8 @@ +-----BEGIN EC PARAMETERS----- +BggqhkjOPQMBBw== +-----END EC PARAMETERS----- -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIChO1xeRf0WA/npKbjLKPzlnTDhE7v95O5ZG2fhZbBjLoAoGCCqGSM49 -AwEHoUQDQgAEI1ezCcJDuCeD1keCoG1R6xR0kIqRzETbu9ODj5pwEEN7ZxIY52MZ -9Ezgw7zfGHpBOb6Awzl/fJmKcYT2uYc+dg== +MHcCAQEEIDUCAKRYHFbz7MVYj4LASsOxX54sYcVNbE4MLwIa/0j/oAoGCCqGSM49 +AwEHoUQDQgAE1ndLf+RmoRDFEm/HYWjiGXUwxw03pW1ln40sQOjoXDMtbihnsAoO +3tkdmUyu2TP7YSkl7jMsDdCVwOgaFvaJ/A== -----END EC PRIVATE KEY----- From f5daea26f9d653bb995665ef79cd6d9af2fa4c2b Mon Sep 17 00:00:00 2001 From: Javier Guerra Melgares Date: Thu, 24 Oct 2019 14:57:46 +0200 Subject: [PATCH 2/3] Show an error message when the OTGC cannot to store a root certificate --- .../view/trustanchor/TrustAnchorView.java | 19 +++++++++++++++++++ .../otgc/viewmodel/TrustAnchorViewModel.java | 7 ++++++- .../properties/Strings_en.properties | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openconnectivity/otgc/view/trustanchor/TrustAnchorView.java b/src/main/java/org/openconnectivity/otgc/view/trustanchor/TrustAnchorView.java index 132436e..2b313c6 100644 --- a/src/main/java/org/openconnectivity/otgc/view/trustanchor/TrustAnchorView.java +++ b/src/main/java/org/openconnectivity/otgc/view/trustanchor/TrustAnchorView.java @@ -22,6 +22,7 @@ import de.saxsys.mvvmfx.FxmlView; import de.saxsys.mvvmfx.InjectViewModel; import javafx.beans.binding.Bindings; +import javafx.beans.value.ObservableValue; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Alert; @@ -31,6 +32,8 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.util.encoders.Base64; import org.openconnectivity.otgc.domain.model.resource.secure.cred.OcCredential; +import org.openconnectivity.otgc.utils.util.Toast; +import org.openconnectivity.otgc.utils.viewmodel.Response; import org.openconnectivity.otgc.viewmodel.TrustAnchorViewModel; import javax.inject.Inject; @@ -50,17 +53,23 @@ public class TrustAnchorView implements FxmlView, Initiali @Inject private Stage primaryStage; + private ResourceBundle resourceBundle; + @FXML private ListView listView; @FXML private JFXButton infoCaButton; @FXML private JFXButton removeCaButton; @Override public void initialize(URL location, ResourceBundle resources) { + this.resourceBundle = resourceBundle; + viewModel.retrieveTrustAnchors(); listView.itemsProperty().bind(viewModel.trustAnchorListProperty()); listView.setCellFactory(deviceListView -> new TrustAnchorViewCell()); + viewModel.storeTrustAnchorResponseProperty().addListener(this::processStoreTrustAnchorResponse); + infoCaButton.disableProperty().bind(Bindings.createBooleanBinding(() -> listView.getSelectionModel().getSelectedItem() == null, listView.getSelectionModel().selectedItemProperty())); @@ -139,6 +148,16 @@ public void handleAddCaButton() { } } + private void processStoreTrustAnchorResponse(ObservableValue> obs, Response oldValue, Response newValue) { + switch (newValue.status) { + case ERROR: + Toast.show(primaryStage, resourceBundle.getString("trustanchor.create_cred.error")); + break; + default: + break; + } + } + @FXML public void handleRemoveCaButton() { viewModel.removeTrustAnchorByCredid(listView.getSelectionModel().getSelectedItem().getCredid()); diff --git a/src/main/java/org/openconnectivity/otgc/viewmodel/TrustAnchorViewModel.java b/src/main/java/org/openconnectivity/otgc/viewmodel/TrustAnchorViewModel.java index 1c8d4c3..a4c4bee 100644 --- a/src/main/java/org/openconnectivity/otgc/viewmodel/TrustAnchorViewModel.java +++ b/src/main/java/org/openconnectivity/otgc/viewmodel/TrustAnchorViewModel.java @@ -53,6 +53,7 @@ public class TrustAnchorViewModel implements ViewModel { public ListProperty trustAnchorListProperty() { return trustAnchorList; } + private final ObjectProperty> storeTrustAnchorResponse = new SimpleObjectProperty<>(); @Inject public TrustAnchorViewModel(SchedulersFacade schedulersFacade, @@ -65,6 +66,10 @@ public TrustAnchorViewModel(SchedulersFacade schedulersFacade, this.remoteRemoveTrustAnchorByCredidUseCase = remoteRemoveTrustAnchorByCredidUseCase; } + public ObjectProperty> storeTrustAnchorResponseProperty() { + return storeTrustAnchorResponse; + } + public void retrieveTrustAnchors() { disposable.add(getTrustAnchorUseCase.execute() .subscribeOn(schedulersFacade.io()) @@ -82,7 +87,7 @@ public void addTrustAnchor(File file) { .observeOn(schedulersFacade.ui()) .subscribe( () -> retrieveTrustAnchors(), - throwable -> {} + throwable -> storeTrustAnchorResponse.set(Response.error(throwable)) )); } diff --git a/src/main/resources/properties/Strings_en.properties b/src/main/resources/properties/Strings_en.properties index b19dd3b..676c575 100644 --- a/src/main/resources/properties/Strings_en.properties +++ b/src/main/resources/properties/Strings_en.properties @@ -163,6 +163,7 @@ linkdevices.radiobutton.uuid=UUID linkdevices.radiobutton.role=Role linkdevices.label.role_id=Role ID linkdevices.label.role_authority= Role authority +trustanchor.create_cred.error=Cannot store root certificate from the selected location ## Dialog dialog.title.select_oxm=Select OTM From ec19f6f950f274225b9ae4e165b593d95f3b72de Mon Sep 17 00:00:00 2001 From: Javier Guerra Melgares Date: Fri, 25 Oct 2019 14:06:15 +0200 Subject: [PATCH 3/3] Update version to 2.6.0 --- build/debian/otgc_native.sh | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/debian/otgc_native.sh b/build/debian/otgc_native.sh index 8ac5ba2..277c6f2 100755 --- a/build/debian/otgc_native.sh +++ b/build/debian/otgc_native.sh @@ -11,7 +11,7 @@ # Constants PROJECT_NAME="otgc" -VERSION="2.5.0" +VERSION="2.6.0" program=$0 diff --git a/pom.xml b/pom.xml index 4fc3c4a..ff71312 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ otgc otgc - 2.5.0 + 2.6.0 UTF-8