Bug 44062 - SecRecord is missing a property to enable password access control
Summary: SecRecord is missing a property to enable password access control
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General (show other bugs)
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: (C9)
Assignee: Alex Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-09-07 16:33 UTC by Ashley Gazich [MSFT]
Modified: 2016-09-27 16:33 UTC (History)
8 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

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