Bug 44062

Summary: SecRecord is missing a property to enable password access control
Product: iOS Reporter: Ashley Gazich [MSFT] <ashley.gazich>
Component: GeneralAssignee: Alex Soto [MSFT] <alex.soto>
Status: VERIFIED FIXED    
Severity: normal CC: brendan.zagaeski, chrisntr, dominic, kmz.zwikstra, mono-bugs+monotouch, Rajneeshk, sebastien, vincent.dondain
Priority: Normal    
Version: master   
Target Milestone: (C9)   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description Ashley Gazich [MSFT] 2016-09-07 16:33:03 UTC
### Customer report

Non-public report https://kb.xamarin.com/agent/case/370436

Customer is having trouble accessing the keychain using SecRecord.
It looks like SecRecord is missing a property to enable password access control
(kSecAccessControlApplicationPassword in iOS9+).

Current workaround:
Access the internal NSMutableDictionary SecRecord.queryDict property using reflection, and add
a value for kSecUseAuthenticationContext. 

Are there plans to extend SecRecord with a UseAuthenticationContext
property (or something similar)? If not, is there an alternative recommended workaround?

Customer included this link for reference:
http://collinbstuart.github.io/lessons/2015/11/04/keychain_entropy/
Comment 1 Vincent Dondain [MSFT] 2016-09-08 17:51:52 UTC
Confirmed, missing binding in https://github.com/xamarin/xamarin-macios/blob/master/src/security.cs#L514-L582
Comment 2 Sebastien Pouliot 2016-09-13 16:02:57 UTC
@Alex please add this to your current work on SecRecord improvements - https://trello.com/c/uw7KfZB3
Comment 3 Alex Soto [MSFT] 2016-09-16 04:45:28 UTC
Propposed PR https://github.com/xamarin/xamarin-macios/pull/842
Comment 4 Alex Soto [MSFT] 2016-09-19 14:45:20 UTC
Fixed in xamarin-macios/master @ 27424075eb802a05312e0849057f41bf4a3d987b