diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/OSXKeychainLibrary.kt b/platform/platform-impl/src/com/intellij/ide/passwordSafe/macOsKeychainLibrary.kt similarity index 98% rename from platform/platform-impl/src/com/intellij/ide/passwordSafe/OSXKeychainLibrary.kt rename to platform/platform-impl/src/com/intellij/ide/passwordSafe/macOsKeychainLibrary.kt index 8199d57bfa41..9b1a1687168c 100644 --- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/OSXKeychainLibrary.kt +++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/macOsKeychainLibrary.kt @@ -25,9 +25,9 @@ val isOSXCredentialsStoreSupported: Boolean // http://developer.apple.com/mac/library/DOCUMENTATION/Security/Reference/keychainservices/Reference/reference.html // It is very, very important to use CFRelease/SecKeychainItemFreeContent You must do it, otherwise you can get "An invalid record was encountered." -interface OSXKeychainLibrary : com.sun.jna.Library { +interface MacOsKeychainLibrary : com.sun.jna.Library { companion object { - private val LIBRARY = com.sun.jna.Native.loadLibrary("Security", OSXKeychainLibrary::class.java) as OSXKeychainLibrary + private val LIBRARY = com.sun.jna.Native.loadLibrary("Security", MacOsKeychainLibrary::class.java) as MacOsKeychainLibrary fun saveGenericPassword(serviceName: ByteArray, accountName: String, password: CharArray) { saveGenericPassword(serviceName, accountName, Charsets.UTF_8.encode(CharBuffer.wrap(password))) diff --git a/plugins/settings-repository/src/keychain/OsXCredentialsStore.kt b/plugins/settings-repository/src/keychain/OsXCredentialsStore.kt index a1fa2a4f1d23..d0c3328de267 100644 --- a/plugins/settings-repository/src/keychain/OsXCredentialsStore.kt +++ b/plugins/settings-repository/src/keychain/OsXCredentialsStore.kt @@ -15,7 +15,7 @@ */ package org.jetbrains.keychain -import com.intellij.ide.passwordSafe.OSXKeychainLibrary +import com.intellij.ide.passwordSafe.MacOsKeychainLibrary import com.intellij.openapi.util.PasswordUtil import gnu.trove.THashMap @@ -39,7 +39,7 @@ class OsXCredentialsStore(serviceName: String) : CredentialsStore { return credentials } - val data = OSXKeychainLibrary.findGenericPassword(getServiceName(sshKeyFile), accountName) ?: return null + val data = MacOsKeychainLibrary.findGenericPassword(getServiceName(sshKeyFile), accountName) ?: return null if (sshKeyFile == null) { val separatorIndex = data.indexOf('@') if (separatorIndex > 0) { @@ -73,12 +73,12 @@ class OsXCredentialsStore(serviceName: String) : CredentialsStore { } val data = if (sshKeyFile == null) "${PasswordUtil.encodePassword(credentials.id)}@${PasswordUtil.encodePassword(credentials.token)}" else credentials.token!! - OSXKeychainLibrary.saveGenericPassword(getServiceName(sshKeyFile), accountName, data) + MacOsKeychainLibrary.saveGenericPassword(getServiceName(sshKeyFile), accountName, data) } override fun reset(host: String) { if (accountToCredentials.remove(host) != null) { - OSXKeychainLibrary.deleteGenericPassword(serviceName, host) + MacOsKeychainLibrary.deleteGenericPassword(serviceName, host) } } }