2016-08-10 5 views
1

私は指紋に関するプロジェクトを進めており、指紋カタログの変更を処理する必要があります。私は、setUserAuthenticationRequired(true)オプションで生成された秘密鍵を使用して、指紋の変更をチェックします。新しい指紋が登録されたり、指紋が登録されなくなったりすると、鍵は不可逆的に無効になります。そのような鍵を使用して暗号操作を初期化しようとすると、KeyPermanentlyInvalidatedExceptionがスローされます。Google Fingerprint APIを使用している場合、Samsung Galaxy S7 Edgeは指紋カタログの変更を検出できません

Galaxy s7で動作することが判明しましたが、s7エッジでは動作しません。 s7エッジでは、新しい指紋を追加するときにキーの検証が行われます。

以下は私のコードです。これはGoogle FingerprintDialogサンプルアプリケーションのものですが、これまでにこの問題がありましたか?ありがとう!

/** 
* Creates a symmetric key in the Android Key Store which can only be used after the user has 
* authenticated with fingerprint. 
*/ 
public void createKey() { 
    try { 
     mKeyStore.load(null); 
     mKeyGenerator.init(new KeyGenParameterSpec.Builder(KEY_NAME, 
       KeyProperties.PURPOSE_ENCRYPT | 
         KeyProperties.PURPOSE_DECRYPT) 
       .setBlockModes(KeyProperties.BLOCK_MODE_CBC) 
         // Require the user to authenticate with a fingerprint to authorize every use 
         // of the key 
       .setUserAuthenticationRequired(true) 
       .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7) 
       .build()); 
     mKeyGenerator.generateKey(); 
    } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException 
      | CertificateException | IOException e) { 
     throw new RuntimeException(e); 
    } 
} 


/** 
* Initialize the {@link Cipher} instance with the created key in the {@link #createKey()} 
* method. 
*/ 
private boolean initCipher() { 
    try { 
     mKeyStore.load(null); 
     SecretKey key = (SecretKey) mKeyStore.getKey(KEY_NAME, null); 
     mCipher.init(Cipher.ENCRYPT_MODE, key); 
     return true; 
    } catch (KeyPermanentlyInvalidatedException e) { //It should throw this exception when adding a new fingerprint, but on s7 edge, it doesn't throw 
     return false; 
    } catch (KeyStoreException | CertificateException | UnrecoverableKeyException | IOException 
      | NoSuchAlgorithmException | InvalidKeyException e) { 
     throw new RuntimeException("Failed to init Cipher", e); 
    } 
} 

型番:SM-G935W8、 Androidのバージョン:6.0.1、 Kenelバージョン:3.18.14-8421152、 ビルド番号:MMB29K。 G935W8VLU1APG1、 Androidセキュリティパッチレベル:2016年7月1日

答えて

2

この問題はSamsungのOSアップデートで修正されました:Kenelバージョン:3.18.14-9105000、ビルド番号:MMB29K。 G935W8VLU2APG1、Androidセキュリティパッチレベル:2016年9月1日

+0

こんにちは、私はまた、サムスンギャラクシーノート4でこの問題に直面しています。私は最新のソフトウェアアップデートをダウンロードしようとしましたが、カーネルバージョンとセキュリティパッチがあなたが言ったバージョンに更新されることを期待しましたが、彼らはそうしませんでした...このデバイスの指紋問題に対する解決策があるかどうか知っていますか?ありがとうございました –

+0

遅く応答して申し訳ありません。注4はGoogle Fingerprint API(Samsung Fingerprintのみ)をサポートしておらず、指紋を使用してキーを保護することはできません。 http://stackoverflow.com/questions/38266406/android-fingerprint-api-ishardwaredetected-returns-false-for-samsung-note-4 –

+0

私はSamsungのPASS SDKについて知りました。キーを保護するのに十分なセキュリティを提供しません。ご回答有難うございます –

関連する問題