From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ben Key Newsgroups: gmane.emacs.devel Subject: Modifying Emacs to use the Mac OS X Keychain Services Date: Tue, 31 May 2011 21:04:00 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00032555505a4baaf904a49cf035 X-Trace: dough.gmane.org 1306894211 3979 80.91.229.12 (1 Jun 2011 02:10:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Jun 2011 02:10:11 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 01 04:10:07 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QRaso-0000R8-VP for ged-emacs-devel@m.gmane.org; Wed, 01 Jun 2011 04:10:07 +0200 Original-Received: from localhost ([::1]:34476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRasn-0000GY-H1 for ged-emacs-devel@m.gmane.org; Tue, 31 May 2011 22:10:05 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRanI-0007jy-Bq for Emacs-devel@gnu.org; Tue, 31 May 2011 22:04:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRanG-0002gD-Bz for Emacs-devel@gnu.org; Tue, 31 May 2011 22:04:23 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:60655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRanF-0002g3-Te for Emacs-devel@gnu.org; Tue, 31 May 2011 22:04:22 -0400 Original-Received: by bwz17 with SMTP id 17so5195775bwz.0 for ; Tue, 31 May 2011 19:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=xkyIo3S37/ng3qCuJW7PE6RU/ljLv7VQcU1QWvyGn/Y=; b=unwwo/iE5Fw6qQBfuYGBBpCpPUzYs7z3h2GFP9m7gd84uNJd288/foKm2BlgKFCxLN SP0GsQet3U8XtgIOQK+UI5FDLa7NwyrVeAbGwbFtzhV6oxsCojf+kZXU3bscS04PaolP ezJrRbwjAR3f8ORrBcXwY6qudNoxLNCto9DNI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=GZ/tMEqjBZn3coSfKfZFo5hGI+cmXNQt8HRKYLk0rU63xyFMlllU15JJdoFQaDt3iJ lAfu/1Rcywyh/Hv36WjvxDThGUCKNrluQag7p6k7/6b/lR1/XRraxEqw5tTV/KFQnt7H eQUvfql4Lf/VcRNNNavlG4v3ED1kpcdHki+8o= Original-Received: by 10.204.20.142 with SMTP id f14mr4464209bkb.155.1306893860186; Tue, 31 May 2011 19:04:20 -0700 (PDT) Original-Received: by 10.204.52.19 with HTTP; Tue, 31 May 2011 19:04:00 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:140011 Archived-At: --00032555505a4baaf904a49cf035 Content-Type: text/plain; charset=ISO-8859-1 Hello, I am still working on this task. I did not finish it by Today as I expected. So far I am working on the ns-keychain-create-item function and the ns-keychain-get-secret function. I will add more functions as I go on. For those who are wondering, here are some details on how I am implementing these functions. The ns-keychain-create-item function has the same parameters as secrets-create-item (collection, item, password, and &rest attributes). It essentially just calls the Keychain Services API functions SecKeychainAddGenericPassword to create the password and SecKeychainItemModifyAttributesAndData to process the attributes. When I call SecKeychainAddGenericPassword I map the collection parameter to the serviceName parameter, the item parameter to the accountName, and the password parameter to the passwordData parameter. The ns-keychain-get-secret function has the same parameters as secrets-get-secret (collection and item) and it essentially just calls SecKeychainFindGenericPassword and returns the retrieved passwordData parameter. Again, when calling SecKeychainFindGenericPassword I map the collection parameter to the serviceName parameter and the item parameter to the accountName parameter. Since I can only work on this project on nights and weekends, it may take me several weeks to complete this task. As Daniel Colascione and Ted Zlatanov recommended I am making the Keychain file the passwords used by Emacs a configurable option that defaults to the default Keychain file. Once I am finished with this task, I will post a patch to this list so that the community can review it before I check it in. It is my hope that this patch will be ready in 3 weeks. --00032555505a4baaf904a49cf035 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

I am still working on this task.=A0 I did no= t finish it by Today as I expected.

So far I am working on the ns-ke= ychain-create-item function and the
ns-keychain-get-secret function.=A0 I will add more functions as I= go on.

For those who are wondering, here are some details on how I am implemen= ting these functions.

The
ns-keychain-create= -item function has the same parameters as secrets-create-item (collection, = item, password, and &rest attributes).=A0 It=A0 essentially just calls = the Keychain Services API functions SecKeychainAddGenericPassword to create= the password and SecKeychainItemModifyAttributesAndData to process the att= ributes.=A0 When I call SecKeychainAddGenericPassw= ord I map the collection parameter to the serviceNa= me parameter, the item parameter to the accountName, and the password param= eter to the passwordData parameter.

The
ns-keychain-get-sec= ret function has the same parameters as secrets-get-secret (collection and = item) and it essentially just calls SecKeychainFindGenericPassword and retu= rns the retrieved passwordData parameter.=A0 Again, when calling SecKeychainFindGenericPassword I map the collection parameter= to the serviceName parameter and the item parameter to the accountName par= ameter.

Since I can only work on this project on nights and weekends, it may ta= ke me several weeks to complete this task.=A0 As Daniel Colascione and Ted = Zlatanov recommended I am making the Keychain file the passwords used by Em= acs a configurable option that defaults to the default Keychain file.

Once I am finished with this task, I will post a patch to this list so = that the community can review it before I check it in.=A0 It is my hope tha= t this patch will be ready in 3 weeks.

--00032555505a4baaf904a49cf035--