From 2113ebe27fd2ac0cbceba52d0610d342330db528 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Fri, 14 Apr 2017 11:08:29 +0200 Subject: [bug 234509] Equinox keystore fragment for Linux 64bit Use libsecret Change-Id: If2a78c2844bce4232f2e15075c28b380a0737ce4 Signed-off-by: Julien HENRY --- .../.classpath | 7 ++ .../.project | 40 +++++++ .../.settings/org.eclipse.core.runtime.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 8 ++ .../META-INF/MANIFEST.MF | 11 ++ .../about.html | 28 +++++ .../build.properties | 21 ++++ .../forceQualifierUpdate.txt | 2 + .../fragment.properties | 14 +++ .../fragment.xml | 18 +++ .../keystorelinuxnative/keystoreLinuxNative.c | 133 +++++++++++++++++++++ .../keystorelinuxnative/keystoreLinuxNative.h | 40 +++++++ .../keystorelinuxnative/makefile | 18 +++ .../libkeystorelinuxnative.so | Bin 0 -> 13160 bytes .../pom.xml | 44 +++++++ .../security/linux/LinuxPasswordProvider.java | 69 +++++++++++ .../linux/nls/LinuxPasswordProviderMessages.java | 31 +++++ .../security/linux/nls/messages.properties | 15 +++ .../org.eclipse.equinox.core.sdk/build.properties | 1 + features/org.eclipse.equinox.core.sdk/feature.xml | 19 +++ pom.xml | 1 + 21 files changed, 522 insertions(+) create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/.classpath create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/.project create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/.settings/org.eclipse.core.runtime.prefs create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/META-INF/MANIFEST.MF create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/about.html create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/build.properties create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/forceQualifierUpdate.txt create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/fragment.properties create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/fragment.xml create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.c create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.h create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/makefile create mode 100755 bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/pom.xml create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/LinuxPasswordProvider.java create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/nls/LinuxPasswordProviderMessages.java create mode 100644 bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/nls/messages.properties diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/.classpath b/bundles/org.eclipse.equinox.security.linux.x86_64/.classpath new file mode 100644 index 000000000..e721d0c4e --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/.project b/bundles/org.eclipse.equinox.security.linux.x86_64/.project new file mode 100644 index 000000000..0bf56d415 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/.project @@ -0,0 +1,40 @@ + + + org.eclipse.equinox.security.linux.x86_64 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature + + diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.equinox.security.linux.x86_64/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..5a0ad22d2 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +line.separator=\n diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.security.linux.x86_64/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..35a117b2f --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.objectteams.otdt.compiler.option.pure_java=enabled diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.security.linux.x86_64/META-INF/MANIFEST.MF new file mode 100644 index 000000000..ad0e44881 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %fragmentName +Bundle-SymbolicName: org.eclipse.equinox.security.linux.x86_64;singleton:=true +Bundle-Version: 1.0.100.qualifier +Bundle-Vendor: %providerName +Fragment-Host: org.eclipse.equinox.security;bundle-version="[1.0.0,2.0.0)" +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-Localization: fragment +Eclipse-PlatformFilter: (& (osgi.os=linux) (osgi.arch=x86_64)) +Export-Package: org.eclipse.equinox.internal.security.linux;x-internal:=true diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/about.html b/bundles/org.eclipse.equinox.security.linux.x86_64/about.html new file mode 100644 index 000000000..460233046 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

June 2, 2006

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/build.properties b/bundles/org.eclipse.equinox.security.linux.x86_64/build.properties new file mode 100644 index 000000000..dbe54d909 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/build.properties @@ -0,0 +1,21 @@ +############################################################################### +# Copyright (c) 2005, 2017 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Julien HENRY - Linux implementation +############################################################################### +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + fragment.properties,\ + fragment.xml,\ + about.html,\ + libkeystorelinuxnative.so +src.includes = keystorelinuxnative/,\ + META-INF/,\ + about.html diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/forceQualifierUpdate.txt b/bundles/org.eclipse.equinox.security.linux.x86_64/forceQualifierUpdate.txt new file mode 100644 index 000000000..2e3e33765 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/forceQualifierUpdate.txt @@ -0,0 +1,2 @@ +# To force a version qualifier update add the bug here + diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/fragment.properties b/bundles/org.eclipse.equinox.security.linux.x86_64/fragment.properties new file mode 100644 index 000000000..d9e05922e --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/fragment.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2017 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Julien HENRY - Linux implementation +############################################################################### +fragmentName = Linux libsecret integration (64 bit) +providerName = Eclipse.org - Equinox +linuxModuleName = Linux Integration (64 bit) +providerDescription = The provider uses libsecret to store a randomly generated user-specific \'master\' password. Users who can log into the operating system account can access contents of the secure storage. diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/fragment.xml b/bundles/org.eclipse.equinox.security.linux.x86_64/fragment.xml new file mode 100644 index 000000000..37dac74eb --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/fragment.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.c b/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.c new file mode 100644 index 000000000..5eee1cb32 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.c @@ -0,0 +1,133 @@ +/******************************************************************************* + * Copyright (c) 2007, 2017 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * LinuxPasswordProviderMessages.java + *******************************************************************************/ +#include +#include "keystoreLinuxNative.h" +#include +#include +#include +#include + +const SecretSchema * +equinox_get_schema (void) +{ + static const SecretSchema the_schema = { + "org.eclipse.equinox", SECRET_SCHEMA_NONE, + { + { "NULL", 0 }, + } + }; + return &the_schema; +} + +#define EQUINOX_SCHEMA equinox_get_schema () + +static void unlock_secret_service(JNIEnv *env) +{ + GError *error = NULL; + GList *l, *ul; + gchar* lbl; + gint nu; + + SecretService* secretservice = secret_service_get_sync(SECRET_SERVICE_LOAD_COLLECTIONS, NULL, &error); + if (error != NULL) { + (*env)->ExceptionClear(env); + char buffer [60]; + sprintf(buffer, "Unable to get secret service: %s", error->message); + (*env)->ThrowNew(env, (* env)->FindClass(env, "java/lang/SecurityException"), buffer); + g_error_free (error); + return; + } + + SecretCollection* defaultcollection = secret_collection_for_alias_sync(secretservice, SECRET_COLLECTION_DEFAULT, SECRET_COLLECTION_NONE, NULL, &error); + if (error != NULL) { + (*env)->ExceptionClear(env); + char buffer [60]; + sprintf(buffer, "Unable to get secret service: %s", error->message); + (*env)->ThrowNew(env, (* env)->FindClass(env, "java/lang/SecurityException"), buffer); + g_error_free (error); + return; + } + + if (secret_collection_get_locked(defaultcollection)) + { + lbl = secret_collection_get_label(defaultcollection); + l = NULL; + l = g_list_append(l, defaultcollection); + nu = secret_service_unlock_sync(secretservice, l, NULL, &ul, &error); + g_list_free(l); + g_list_free(ul); + if (error != NULL) { + (*env)->ExceptionClear(env); + char buffer [60]; + sprintf(buffer, "Unable to unlock: %s", error->message); + (*env)->ThrowNew(env, (* env)->FindClass(env, "java/lang/SecurityException"), buffer); + g_error_free (error); + return; + } + + } + return; +} + +JNIEXPORT jstring JNICALL Java_org_eclipse_equinox_internal_security_linux_LinuxPasswordProvider_getMasterPassword(JNIEnv *env, jobject this) { + GError *error = NULL; + jstring result; + + unlock_secret_service(env); + if ((*env)->ExceptionOccurred(env)) { + return NULL; + } + + gchar *password = secret_password_lookup_sync(EQUINOX_SCHEMA, NULL, &error, NULL); + + if (error != NULL) { + (*env)->ExceptionClear(env); + char buffer [60]; + sprintf(buffer, "%s. Result: %d", error->message, error->code); + (*env)->ThrowNew(env, (* env)->FindClass(env, "java/lang/SecurityException"), buffer); + g_error_free (error); + return NULL; + } else if (password == NULL) { + (*env)->ExceptionClear(env); + (*env)->ThrowNew(env, (* env)->FindClass(env, "java/lang/SecurityException"), "Unable to find password"); + return NULL; + } else { + result = (*env)->NewStringUTF(env, password); + free(password); + return result; + } +} + +JNIEXPORT void JNICALL Java_org_eclipse_equinox_internal_security_linux_LinuxPasswordProvider_saveMasterPassword(JNIEnv *env, jobject this, jstring password) { + GError *error = NULL; + + unlock_secret_service(env); + if ((*env)->ExceptionOccurred(env)) { + return; + } + + const char *passwordUTF = (*env)->GetStringUTFChars(env, password, NULL); + secret_password_store_sync (EQUINOX_SCHEMA, SECRET_COLLECTION_DEFAULT, + "Equinox master password", passwordUTF, NULL, &error, + NULL); + + // free the UTF strings + (*env)->ReleaseStringUTFChars( env, password, passwordUTF ); + + if (error != NULL) { + (*env)->ExceptionClear(env); + char buffer [60]; + sprintf(buffer, "%s. Result: %d", error->message, error->code); + (*env)->ThrowNew(env, (* env)->FindClass(env, "java/lang/SecurityException"), buffer); + g_error_free (error); + } +} + diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.h b/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.h new file mode 100644 index 000000000..7dc1aedf8 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/keystoreLinuxNative.h @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2007, 2017 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * LinuxPasswordProviderMessages.java + *******************************************************************************/ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class LinuxPasswordProvider */ + +#ifndef _Included_LinuxPasswordProvider +#define _Included_LinuxPasswordProvider +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Class: LinuxPasswordProvider + * Method: getMasterPassword + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_eclipse_equinox_internal_security_linux_LinuxPasswordProvider_getMasterPassword + (JNIEnv *, jobject); + +/* + * Class: LinuxPasswordProvider + * Method: saveMasterPassword + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_eclipse_equinox_internal_security_linux_LinuxPasswordProvider_saveMasterPassword + (JNIEnv *, jobject, jstring); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/makefile b/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/makefile new file mode 100644 index 000000000..c2551614c --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/keystorelinuxnative/makefile @@ -0,0 +1,18 @@ +LIBSECRET_CFLAGS = `pkg-config --cflags libsecret-1` +LIBSECRET_LIBS = `pkg-config --libs libsecret-1` + +CFLAGS = -shared -fPIC -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/linux" + +all: ../libkeystorelinuxnative.so + +clean: + rm ../libkeystorelinuxnative.so ../target/keystoreLinuxNative.o + +../libkeystorelinuxnative.so: ../target/keystoreLinuxNative.o + $(CC) $(CFLAGS) -o $@ $< $(LIBSECRET_LIBS) + +../target/keystoreLinuxNative.o: ../target keystoreLinuxNative.c + $(CC) -c -fPIC -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/linux" -o $@ $(TESTFLAGS) $(LIBSECRET_CFLAGS) keystoreLinuxNative.c + +../target: + mkdir -p ../target diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so b/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so new file mode 100755 index 000000000..c1490337f Binary files /dev/null and b/bundles/org.eclipse.equinox.security.linux.x86_64/libkeystorelinuxnative.so differ diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/pom.xml b/bundles/org.eclipse.equinox.security.linux.x86_64/pom.xml new file mode 100644 index 000000000..0c44835a3 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/pom.xml @@ -0,0 +1,44 @@ + + + + 4.0.0 + + rt.equinox.bundles + org.eclipse.equinox.bundles + 4.7.0-SNAPSHOT + ../../ + + org.eclipse.equinox + org.eclipse.equinox.security.linux.x86_64 + 1.0.100-SNAPSHOT + eclipse-plugin + + + + + org.eclipse.tycho + target-platform-configuration + ${tycho.version} + + p2 + + + linux + gtk + x86_64 + + + + + + + diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/LinuxPasswordProvider.java b/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/LinuxPasswordProvider.java new file mode 100644 index 000000000..8ae41c7e1 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/LinuxPasswordProvider.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright (c) 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Julien HENRY - Linux implementation + *******************************************************************************/ +package org.eclipse.equinox.internal.security.linux; + +import java.security.SecureRandom; +import javax.crypto.spec.PBEKeySpec; +import org.eclipse.equinox.internal.security.auth.AuthPlugin; +import org.eclipse.equinox.internal.security.linux.nls.LinuxPasswordProviderMessages; +import org.eclipse.equinox.internal.security.storage.Base64; +import org.eclipse.equinox.security.storage.provider.IPreferencesContainer; +import org.eclipse.equinox.security.storage.provider.PasswordProvider; + +public class LinuxPasswordProvider extends PasswordProvider { + + /** + * The length of the randomly generated password in bytes + */ + private static final int PASSWORD_LENGTH = 64; + + private native String getMasterPassword() throws SecurityException; + + private native void saveMasterPassword(String password) throws SecurityException; + + static { + System.loadLibrary("keystorelinuxnative"); //$NON-NLS-1$ + } + + @Override + public PBEKeySpec getPassword(IPreferencesContainer container, int passwordType) { + + boolean newPassword = (passwordType & CREATE_NEW_PASSWORD) != 0; + boolean passwordChange = (passwordType & PASSWORD_CHANGE) != 0; + + if (!newPassword && !passwordChange) { + try { + return new PBEKeySpec(getMasterPassword().toCharArray()); + } catch (SecurityException e) { + AuthPlugin.getDefault().logError(LinuxPasswordProviderMessages.getMasterPasswordError, e); + return null; + } + } + + byte[] rawPassword = new byte[PASSWORD_LENGTH]; + SecureRandom random = new SecureRandom(); + random.setSeed(System.currentTimeMillis()); + random.nextBytes(rawPassword); + String newPasswordString = Base64.encode(rawPassword); + + // add info message in the log + AuthPlugin.getDefault().logMessage(LinuxPasswordProviderMessages.newMasterPasswordGenerated); + + try { + saveMasterPassword(newPasswordString); + return new PBEKeySpec(newPasswordString.toCharArray()); + } catch (SecurityException e) { + AuthPlugin.getDefault().logError(LinuxPasswordProviderMessages.saveMasterPasswordError, e); + return null; + } + } + +} diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/nls/LinuxPasswordProviderMessages.java b/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/nls/LinuxPasswordProviderMessages.java new file mode 100644 index 000000000..06e6e622a --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/nls/LinuxPasswordProviderMessages.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Julien HENRY - Linux implementation + *******************************************************************************/ +package org.eclipse.equinox.internal.security.linux.nls; + +import org.eclipse.osgi.util.NLS; + +public class LinuxPasswordProviderMessages extends NLS { + + private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.security.linux.nls.messages"; //$NON-NLS-1$ + + public static String getMasterPasswordError; + public static String saveMasterPasswordError; + public static String newMasterPasswordGenerated; + + static { + // load message values from bundle file + reloadMessages(); + } + + public static void reloadMessages() { + NLS.initializeMessages(BUNDLE_NAME, LinuxPasswordProviderMessages.class); + } +} diff --git a/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/nls/messages.properties b/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/nls/messages.properties new file mode 100644 index 000000000..86cdba686 --- /dev/null +++ b/bundles/org.eclipse.equinox.security.linux.x86_64/src/org/eclipse/equinox/internal/security/linux/nls/messages.properties @@ -0,0 +1,15 @@ +############################################################################### +# Copyright (c) 2017 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Julien HENRY - Linux implementation +############################################################################### + +## Linux libsecure integration module +getMasterPasswordError=Secure storage was unable to retrieve the master password from the password storage. If secure storage was created using a different user account, you'll have to switch back to that account. Alternatively, you can use the password recovery, or delete and re-create secure storage. +saveMasterPasswordError=Secure storage was unable to save the master password. +newMasterPasswordGenerated=New secure storage master password was generated (Linux libsecret integration module). diff --git a/features/org.eclipse.equinox.core.sdk/build.properties b/features/org.eclipse.equinox.core.sdk/build.properties index e24385bb3..ea7478c26 100644 --- a/features/org.eclipse.equinox.core.sdk/build.properties +++ b/features/org.eclipse.equinox.core.sdk/build.properties @@ -26,6 +26,7 @@ generate.plugin@org.eclipse.osgi.source=org.eclipse.osgi generate.plugin@org.eclipse.osgi.util.source=org.eclipse.osgi.util generate.plugin@org.eclipse.equinox.security.win32.x86.source=org.eclipse.equinox.security.win32.x86 generate.plugin@org.eclipse.equinox.security.win32.x86_64.source=org.eclipse.equinox.security.win32.x86_64 +generate.plugin@org.eclipse.equinox.security.linux.x86_64.source=org.eclipse.equinox.security.linux.x86_64 generate.plugin@org.eclipse.equinox.security.macosx.source=org.eclipse.equinox.security.macosx generate.plugin@org.eclipse.equinox.security.source=org.eclipse.equinox.security generate.plugin@org.eclipse.equinox.security.ui.source=org.eclipse.equinox.security.ui diff --git a/features/org.eclipse.equinox.core.sdk/feature.xml b/features/org.eclipse.equinox.core.sdk/feature.xml index b69a2ee8b..ed775febc 100644 --- a/features/org.eclipse.equinox.core.sdk/feature.xml +++ b/features/org.eclipse.equinox.core.sdk/feature.xml @@ -235,6 +235,25 @@ version="0.0.0" unpack="false"/> + + + + bundles/org.eclipse.equinox.security.macosx bundles/org.eclipse.equinox.security.win32.x86 bundles/org.eclipse.equinox.security.win32.x86_64 + bundles/org.eclipse.equinox.security.linux.x86_64 bundles/org.eclipse.equinox.bidi bundles/org.eclipse.equinox.cm bundles/org.eclipse.equinox.console -- cgit v1.2.3