From af56fb05446ab291e85d7d4fa5d7d6625210ea4c Mon Sep 17 00:00:00 2001 From: Elena Parovyshnaia Date: Wed, 31 Mar 2021 11:17:09 +0300 Subject: [PATCH 1/2] Bug 572366 verify product's public key on hc-fls interaction move not-generated floating.model utils to 'internal' package Signed-off-by: eparovyshnaya --- .../internal/base/ServerAuthenticationInstructions.java | 4 ++-- .../eclipse/passage/lic/internal/base/logging/Logging.java | 1 + .../META-INF/MANIFEST.MF | 6 +++--- .../{ => internal}/model/convert/EGrantAcquisition.java | 4 ++-- .../{ => internal}/model/convert/PGrantAcquisition.java | 7 ++++--- .../model/net/ServerAuthenticationExpression.java | 4 ++-- .../{ => internal}/model/net/ServerAuthenticationType.java | 4 ++-- .../lic/internal/hc/remote/impl/RequestParameters.java | 4 ++-- .../lic/internal/hc/remote/impl/acquire/RemoteAcquire.java | 2 +- .../lic/internal/hc/remote/impl/acquire/RemoteRelease.java | 2 +- .../src/org/eclipse/passage/lbc/base/tests/MineTest.java | 5 +++-- .../eclipse/passage/lbc/base/tests/RequestConstructed.java | 4 ++-- .../passage/lbc/base/tests/ServerAuthenticationTest.java | 5 +++-- .../lic/internal/hc/tests/RemoteConditionsRequestTest.java | 4 ++-- 14 files changed, 30 insertions(+), 26 deletions(-) rename bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/{ => internal}/model/convert/EGrantAcquisition.java (92%) rename bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/{ => internal}/model/convert/PGrantAcquisition.java (83%) rename bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/{ => internal}/model/net/ServerAuthenticationExpression.java (91%) rename bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/{ => internal}/model/net/ServerAuthenticationType.java (91%) diff --git a/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/ServerAuthenticationInstructions.java b/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/ServerAuthenticationInstructions.java index 52fe408d7..5b8f45e1b 100644 --- a/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/ServerAuthenticationInstructions.java +++ b/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/ServerAuthenticationInstructions.java @@ -15,8 +15,8 @@ import java.util.Optional; import java.util.function.Supplier; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationExpression; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationType; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationExpression; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationType; import org.eclipse.passage.lic.internal.api.EvaluationInstructions; import org.eclipse.passage.lic.internal.api.EvaluationType; import org.eclipse.passage.lic.internal.base.conditions.BaseEvaluationInstructions; diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/logging/Logging.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/logging/Logging.java index 120df92bd..310d16276 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/logging/Logging.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/logging/Logging.java @@ -29,6 +29,7 @@ public Logging(ConfigSupplier config) { @SuppressWarnings("resource") public void configure() { try { + System.setProperty("org.apache.logging.log4j.simplelog.StatusLogger.level", "ERROR"); //$NON-NLS-1$//$NON-NLS-2$ ConfigurationSource source = new ConfigurationSource(new FileInputStream(config.get().toFile())); Configurator.initialize(getClass().getClassLoader().getParent(), source); } catch (Exception e) { diff --git a/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF index b6f68b1dd..e06094951 100644 --- a/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF @@ -14,7 +14,9 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0";resolution:=opti org.eclipse.passage.lic.floating;bundle-version="0.0.0";visibility:=reexport, org.eclipse.passage.lic.api;bundle-version="1.0.100", org.eclipse.passage.lic.base;bundle-version="1.0.100" -Export-Package: org.eclipse.passage.lic.floating.model.api; +Export-Package: org.eclipse.passage.lic.floating.internal.model.convert;x-friends:="org.eclipse.passage.lic.hc", + org.eclipse.passage.lic.floating.internal.model.net;x-friends:="org.eclipse.passage.lbc.base,org.eclipse.passage.lic.hc", + org.eclipse.passage.lic.floating.model.api; x-friends:="org.eclipse.passage.lic.floating.edit, org.eclipse.passage.loc.dashboard.ui, org.eclipse.passage.loc.api, @@ -24,7 +26,6 @@ Export-Package: org.eclipse.passage.lic.floating.model.api; org.eclipse.passage.lbc.base, org.eclipse.passage.lbc.api, org.eclipse.passage.lbc.base.tests", - org.eclipse.passage.lic.floating.model.convert;x-friends:="org.eclipse.passage.lic.hc", org.eclipse.passage.lic.floating.model.impl;x-internal:=true, org.eclipse.passage.lic.floating.model.meta; x-friends:="org.eclipse.passage.lic.floating.e4.ui, @@ -35,7 +36,6 @@ Export-Package: org.eclipse.passage.lic.floating.model.api; org.eclipse.passage.lbc.base, org.eclipse.passage.lbc.base.tests, org.eclipse.passage.lic.hc", - org.eclipse.passage.lic.floating.model.net, org.eclipse.passage.lic.floating.model.util;x-friends:="org.eclipse.passage.lic.floating.edit" Bundle-ClassPath: . Bundle-ActivationPolicy: lazy diff --git a/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/convert/EGrantAcquisition.java b/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/convert/EGrantAcquisition.java similarity index 92% rename from bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/convert/EGrantAcquisition.java rename to bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/convert/EGrantAcquisition.java index 82538473e..d6003efee 100644 --- a/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/convert/EGrantAcquisition.java +++ b/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/convert/EGrantAcquisition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 ArSysOp + * Copyright (c) 2020, 2021 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -10,7 +10,7 @@ * Contributors: * ArSysOp - initial API and implementation *******************************************************************************/ -package org.eclipse.passage.lic.floating.model.convert; +package org.eclipse.passage.lic.floating.internal.model.convert; import java.util.function.Supplier; diff --git a/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/convert/PGrantAcquisition.java b/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/convert/PGrantAcquisition.java similarity index 83% rename from bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/convert/PGrantAcquisition.java rename to bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/convert/PGrantAcquisition.java index 960b6141c..6da05100c 100644 --- a/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/convert/PGrantAcquisition.java +++ b/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/convert/PGrantAcquisition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 ArSysOp + * Copyright (c) 2020, 2021 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -10,7 +10,7 @@ * Contributors: * ArSysOp - initial API and implementation *******************************************************************************/ -package org.eclipse.passage.lic.floating.model.convert; +package org.eclipse.passage.lic.floating.internal.model.convert; import java.util.Objects; import java.util.function.Supplier; @@ -18,7 +18,8 @@ import org.eclipse.passage.lic.floating.model.api.GrantAcqisition; import org.eclipse.passage.lic.internal.base.acquire.BaseGrantAcquisition; -public final class PGrantAcquisition implements Supplier { +public final class PGrantAcquisition + implements Supplier { private final GrantAcqisition source; diff --git a/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/net/ServerAuthenticationExpression.java b/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/net/ServerAuthenticationExpression.java similarity index 91% rename from bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/net/ServerAuthenticationExpression.java rename to bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/net/ServerAuthenticationExpression.java index 9c1bf92bb..f89b52ba3 100644 --- a/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/net/ServerAuthenticationExpression.java +++ b/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/net/ServerAuthenticationExpression.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 ArSysOp + * Copyright (c) 2020, 2021 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -10,7 +10,7 @@ * Contributors: * ArSysOp - initial API and implementation *******************************************************************************/ -package org.eclipse.passage.lic.floating.model.net; +package org.eclipse.passage.lic.floating.internal.model.net; import java.util.function.Function; diff --git a/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/net/ServerAuthenticationType.java b/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/net/ServerAuthenticationType.java similarity index 91% rename from bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/net/ServerAuthenticationType.java rename to bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/net/ServerAuthenticationType.java index c5b943dc4..2c8f1a8e4 100644 --- a/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/model/net/ServerAuthenticationType.java +++ b/bundles/org.eclipse.passage.lic.floating.model/src/org/eclipse/passage/lic/floating/internal/model/net/ServerAuthenticationType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 ArSysOp + * Copyright (c) 2020, 2021 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -10,7 +10,7 @@ * Contributors: * ArSysOp - initial API and implementation *******************************************************************************/ -package org.eclipse.passage.lic.floating.model.net; +package org.eclipse.passage.lic.floating.internal.model.net; import java.util.function.Function; diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RequestParameters.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RequestParameters.java index 514dfba20..93d2ce76b 100644 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RequestParameters.java +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RequestParameters.java @@ -18,9 +18,9 @@ import java.util.List; import java.util.stream.Collectors; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationExpression; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationType; import org.eclipse.passage.lic.floating.model.api.FloatingLicenseAccess; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationExpression; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationType; import org.eclipse.passage.lic.internal.api.LicensedProduct; import org.eclipse.passage.lic.internal.api.LicensingException; import org.eclipse.passage.lic.internal.api.PassageAction; diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/acquire/RemoteAcquire.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/acquire/RemoteAcquire.java index 4e1d04a4e..3fa07cfbe 100644 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/acquire/RemoteAcquire.java +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/acquire/RemoteAcquire.java @@ -15,8 +15,8 @@ import java.nio.file.Path; import java.util.function.Supplier; +import org.eclipse.passage.lic.floating.internal.model.convert.PGrantAcquisition; import org.eclipse.passage.lic.floating.model.api.FloatingLicenseAccess; -import org.eclipse.passage.lic.floating.model.convert.PGrantAcquisition; import org.eclipse.passage.lic.internal.api.LicensingException; import org.eclipse.passage.lic.internal.api.acquire.GrantAcquisition; import org.eclipse.passage.lic.internal.api.io.HashesRegistry; diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/acquire/RemoteRelease.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/acquire/RemoteRelease.java index c545d6449..e5ba30af6 100644 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/acquire/RemoteRelease.java +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/acquire/RemoteRelease.java @@ -15,8 +15,8 @@ import java.nio.file.Path; import java.util.function.Supplier; +import org.eclipse.passage.lic.floating.internal.model.convert.EGrantAcquisition; import org.eclipse.passage.lic.floating.model.api.FloatingLicenseAccess; -import org.eclipse.passage.lic.floating.model.convert.EGrantAcquisition; import org.eclipse.passage.lic.internal.api.LicensingException; import org.eclipse.passage.lic.internal.api.acquire.GrantAcquisition; import org.eclipse.passage.lic.internal.api.io.HashesRegistry; diff --git a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/MineTest.java b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/MineTest.java index 2586f436c..a6dfbd035 100644 --- a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/MineTest.java +++ b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/MineTest.java @@ -18,8 +18,8 @@ import java.util.Arrays; import org.eclipse.passage.lbc.internal.base.FlotingRequestHandled; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationExpression; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationType; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationExpression; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationType; import org.eclipse.passage.lic.internal.api.EvaluationType; import org.eclipse.passage.lic.internal.api.PassageAction; import org.eclipse.passage.lic.internal.base.ProductIdentifier; @@ -29,6 +29,7 @@ import org.eclipse.passage.lic.internal.net.handle.Failure; import org.junit.Test; +@SuppressWarnings("restriction") public final class MineTest { @Test diff --git a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/RequestConstructed.java b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/RequestConstructed.java index a2c65b9d0..5fc1f092c 100644 --- a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/RequestConstructed.java +++ b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/RequestConstructed.java @@ -21,8 +21,8 @@ import org.eclipse.passage.lbc.internal.base.EagerFloatingState; import org.eclipse.passage.lbc.internal.base.api.FloatingState; import org.eclipse.passage.lbc.internal.base.api.RawRequest; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationExpression; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationType; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationExpression; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationType; import org.eclipse.passage.lic.internal.api.EvaluationType; import org.eclipse.passage.lic.internal.api.PassageAction; import org.eclipse.passage.lic.internal.base.NamedData; diff --git a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/ServerAuthenticationTest.java b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/ServerAuthenticationTest.java index 11f5a3635..baa867b6c 100644 --- a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/ServerAuthenticationTest.java +++ b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/ServerAuthenticationTest.java @@ -16,8 +16,8 @@ import static org.junit.Assert.assertTrue; import org.eclipse.passage.lbc.internal.base.FlotingRequestHandled; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationExpression; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationType; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationExpression; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationType; import org.eclipse.passage.lic.internal.api.EvaluationType; import org.eclipse.passage.lic.internal.api.PassageAction; import org.eclipse.passage.lic.internal.base.StringNamedData; @@ -25,6 +25,7 @@ import org.eclipse.passage.lic.internal.net.handle.Failure; import org.junit.Test; +@SuppressWarnings("restriction") public final class ServerAuthenticationTest { @Test diff --git a/tests/org.eclipse.passage.lic.hc.tests/src/org/eclipse/passage/lic/internal/hc/tests/RemoteConditionsRequestTest.java b/tests/org.eclipse.passage.lic.hc.tests/src/org/eclipse/passage/lic/internal/hc/tests/RemoteConditionsRequestTest.java index ee3100696..8f022f548 100644 --- a/tests/org.eclipse.passage.lic.hc.tests/src/org/eclipse/passage/lic/internal/hc/tests/RemoteConditionsRequestTest.java +++ b/tests/org.eclipse.passage.lic.hc.tests/src/org/eclipse/passage/lic/internal/hc/tests/RemoteConditionsRequestTest.java @@ -20,12 +20,12 @@ import java.io.IOException; import java.net.URL; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationExpression; +import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationType; import org.eclipse.passage.lic.floating.model.api.EvaluationInstructions; import org.eclipse.passage.lic.floating.model.api.FloatingLicenseAccess; import org.eclipse.passage.lic.floating.model.api.FloatingServerConnection; import org.eclipse.passage.lic.floating.model.meta.FloatingFactory; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationExpression; -import org.eclipse.passage.lic.floating.model.net.ServerAuthenticationType; import org.eclipse.passage.lic.internal.api.LicensedProduct; import org.eclipse.passage.lic.internal.api.LicensingException; import org.eclipse.passage.lic.internal.api.PassageAction; From 3d2a8760af04cb3caa4ee64cdae4f189a6c4519a Mon Sep 17 00:00:00 2001 From: Elena Parovyshnaia Date: Wed, 31 Mar 2021 11:30:00 +0300 Subject: [PATCH 2/2] Bug 572366 verify product's public key on hc-fls interaction Bump service version for altered bundle Signed-off-by: eparovyshnaya --- .../org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF index e06094951..e57b0d2e6 100644 --- a/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Automatic-Module-Name: org.eclipse.passage.lic.floating.model Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.passage.lic.floating.model;singleton:=true -Bundle-Version: 0.1.100.qualifier +Bundle-Version: 0.1.101.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Copyright: %Bundle-Copyright