Skip to content

Commit

Permalink
Merge pull request #387 from WalletConnect/feature/keychain-override-…
Browse files Browse the repository at this point in the history
…#360

[Core] Allow to override key in keychain
  • Loading branch information
flypaper0 authored Jul 29, 2022
2 parents 34af3e4 + 71fb806 commit f3ced49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/WalletConnectKMS/Keychain/KeychainStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public final class KeychainStorage: KeychainStorageProtocol {

let status = secItem.add(query as CFDictionary, nil)

guard status != errSecDuplicateItem else {
return try update(data: data, forKey: key)
}

guard status == errSecSuccess else {
throw KeychainError(status)
}
Expand Down

0 comments on commit f3ced49

Please sign in to comment.