[MacPorts] #43466: textmate2 @2.0-alpha.9537 configure error - "Unknown signee" while downloading TextMate Bundles

MacPorts noreply at macports.org
Wed Jun 11 23:25:34 PDT 2014


#43466: textmate2 @2.0-alpha.9537 configure error - "Unknown signee" while
downloading TextMate Bundles
-------------------------------+-------------------
  Reporter:  david.hislop.1@…  |      Owner:  cal@…
      Type:  defect            |     Status:  new
  Priority:  Normal            |  Milestone:
 Component:  ports             |    Version:  2.2.1
Resolution:                    |   Keywords:
      Port:  textmate2         |
-------------------------------+-------------------

Comment (by david.hislop.1@…):

 I fixed it and built TextMate successfully.

 Had to first fix a bug that was preventing an error message displaying
 correctly and then I hazarded a guess at the likely solution.

 In file key_chain.cc, the line {{{if(err = SecItemImport(data, NULL,
 &type, &format, 0, &params, NULL, &items) == errSecSuccess)}}} causes
 variable {{{err}}} to be set to the result of the logical expression,
 whereas the intent is to set it to the return value of
 {{{SecItemImport}}}. Needs either parentheses or splitting into an
 assignment and an {{{if()}}}. I chose the latter as in the diff output
 below.

 Also, the
 [https://developer.apple.com/library/mac/documentation/security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/uid/TP30000898
 -CH1g-SW49 documentation for SecItemImport] shows that the sequence of
 parameters {{{&type}}} and {{{&format}}} is wrong. I reversed them.

 These changes didn't fix the problem but at least showed that
 SecItemImport was returning {{{errSecAddinLoadFailed}}}. On a hunch, I
 changed both {{{&type}}} and {{{&format}}} to pass the "unknown" enum and
 that fixed the problem.

 I've included below the diff of the resulting changes, with a long comment
 added explaining that I didn't investigate whether both {{{&type}}} and
 {{{&format}}} needed to be changed or just one. If I had to guess, I'd say
 it was {{{&format}}}.

 I'll also pass this onto the TextMate list.

 Thanks for your help. I have no idea how this was working for you and not
 me. Wild guess: maybe your TextMate keychain has entries in it that mine
 doesn't and the build I was doing attempted to add one that's broken.

 {{{
 *** /tmp/key_chain.cc   2014-06-12 15:55:45.000000000 +1000
 --- /tmp/key_chain.cc_orig      2014-06-12 15:55:45.000000000 +1000
 ***************
 *** 31,56 ****
         bool res = false;

         SecItemImportExportKeyParameters params = { .keyUsage = NULL,
 .keyAttributes = NULL };
 !       /*****************************************************
 !       /* Specifying the expected Item Type and Format
 !        * caused SecItemImport to return
 !        * errSecAddinLoadFailed.
 !        * I didn't check whether it was due to both being
 !        * specified or just one. Setting to the Unknown enum
 !        * worked.
 !        * Original code on next two comment lines.
 !       /* SecExternalItemType type = kSecItemTypePublicKey;
 !       /* SecExternalFormat format = kSecFormatPEMSequence;
 !        * Updated code with both vars set to unknown on next
 !        * two lines. */
 !       SecExternalFormat format = kSecFormatUnknown;
 !       SecExternalItemType type = kSecItemTypeUnknown;

         CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const
 UInt8*)_key_data.data(), _key_data.size(), kCFAllocatorNull);
         CFArrayRef items = NULL;
         OSStatus err;
 !       err = SecItemImport(data, NULL, &format, &type, 0, &params, NULL,
 &items);
 !       if(err == errSecSuccess)
         {
                 _sec_key = (SecKeyRef)CFArrayGetValueAtIndex(items, 0);
                 if(_sec_key != NULL)
 --- 31,43 ----
         bool res = false;

         SecItemImportExportKeyParameters params = { .keyUsage = NULL,
 .keyAttributes = NULL };
 !       SecExternalItemType type = kSecItemTypePublicKey;
 !       SecExternalFormat format = kSecFormatPEMSequence;

         CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const
 UInt8*)_key_data.data(), _key_data.size(), kCFAllocatorNull);
         CFArrayRef items = NULL;
         OSStatus err;
 !       if(err = SecItemImport(data, NULL, &type, &format, 0, &params,
 NULL, &items) == errSecSuccess)
         {
                 _sec_key = (SecKeyRef)CFArrayGetValueAtIndex(items, 0);
                 if(_sec_key != NULL)
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/43466#comment:3>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list