Skip to content

Commit

Permalink
Disable the native keychain support
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Nov 25, 2019
1 parent 6ced36b commit 98762c1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,25 @@ public static CredentialsManager getCredentialsManager(
if (Platform.isCurrentPlatform(Platform.WINDOWS)) {
return new WinCredentialsManager();
}

if (Platform.isCurrentPlatform(Platform.MAC_OS_X) && !usePersistanceCredentialsManager) {
/*
* Mac OS uses Keychain for credential storage by default unless the
* user specifies using PersistanceStoreCredentialsManager
*/
return new KeychainCredentialsManager();
}

if (Platform.isCurrentPlatform(Platform.LINUX)
&& !usePersistanceCredentialsManager
&& GnomeKeyringCredentialsManager.isGnomeKeyringSupported()) {

/*
* Linux uses gnome-keyring if it's available unless the user
* specifies using PersistanceStoreCredentialsManager
*/
return new GnomeKeyringCredentialsManager();
}
// TODO: No keychains are supported for now.
// if (Platform.isCurrentPlatform(Platform.MAC_OS_X) && !usePersistanceCredentialsManager) {
// /*
// * Mac OS uses Keychain for credential storage by default unless the
// * user specifies using PersistanceStoreCredentialsManager
// */
// return new KeychainCredentialsManager();
// }
//
// if (Platform.isCurrentPlatform(Platform.LINUX)
// && !usePersistanceCredentialsManager
// && GnomeKeyringCredentialsManager.isGnomeKeyringSupported()) {
//
// /*
// * Linux uses gnome-keyring if it's available unless the user
// * specifies using PersistanceStoreCredentialsManager
// */
// return new GnomeKeyringCredentialsManager();
// }

return new PersistenceStoreCredentialsManager(persistenceProvider.getConfigurationPersistenceStore());
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
*/
public abstract class LibraryNames {

/**
* The short name of the keychain library.
*/
public static final String KEYCHAIN_LIBRARY_NAME = "native_keychain"; //$NON-NLS-1$

/**
* The short name of the Windows credential library.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@
* @threadsafety unknown
*/
public class NativeKeychain implements Keychain {
/**
* This static initializer is a "best-effort" native code loader (no
* exceptions thrown for normal load failures).
*
* Apps with multiple classloaders (like Eclipse) can run this initializer
* more than once in a single JVM OS process, and on some platforms
* (Windows) the native libraries will fail to load the second time, because
* they're already loaded. This failure can be ignored because the native
* code will execute fine.
*/
static {
NativeLoader.loadLibraryAndLogError(LibraryNames.KEYCHAIN_LIBRARY_NAME);
}

/**
* {@inheritDoc}
Expand Down Expand Up @@ -75,11 +62,19 @@ public boolean removeInternetPassword(final KeychainInternetPassword password, f
return nativeRemoveInternetPassword(password, allowUi);
}

private static native boolean nativeAddInternetPassword(Object password, boolean allowUi);
private static boolean nativeAddInternetPassword(Object password, boolean allowUi) {
return false;
}

private static native boolean nativeModifyInternetPassword(Object oldPassword, Object newPassword, boolean allowUi);
private static boolean nativeModifyInternetPassword(Object oldPassword, Object newPassword, boolean allowUi) {
return false;
}

private static native Object nativeFindInternetPassword(Object password, boolean allowUi);
private static Object nativeFindInternetPassword(Object password, boolean allowUi) {
return null;
}

private static native boolean nativeRemoveInternetPassword(Object password, boolean allowUi);
private static boolean nativeRemoveInternetPassword(Object password, boolean allowUi) {
return false;
}
}
1 change: 0 additions & 1 deletion source/com.microsoft.tfs.sdk/redist/redist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ThirdPartyNotices.html

lib/com.microsoft.tfs.sdk-14.134.0.jar

native/macosx/libnative_keychain.jnilib
native/macosx/libnative_console.jnilib

native/aix/ppc/libnative_console.a
Expand Down

0 comments on commit 98762c1

Please sign in to comment.