<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I attempted to build the MacPorts textmate2 port, originally for 2.0-alpha.9537, and got an "unknown signee" error during configure when it attempted to download the bundles.<div><br></div><div>I reported it on MacPorts Trac: <a href="https://trac.macports.org/ticket/43466">https://trac.macports.org/ticket/43466</a>. That ticket contains the steps I took and also now contains what I did to get the build to work.</div><div><br></div><div>My problem seems very similar to</div><div><a href="http://lists.macromates.com/textmate/2013-February/035922.html">http://lists.macromates.com/textmate/2013-February/035922.html</a> </div><div><a href="http://textmate.1073791.n5.nabble.com/Unknown-signee-errors-td25943.html">http://textmate.1073791.n5.nabble.com/Unknown-signee-errors-td25943.html</a></div><div>and</div><div><a href="http://permalink.gmane.org/gmane.os.apple.macports.tickets/68860">http://permalink.gmane.org/gmane.os.apple.macports.tickets/68860</a></div><div><div><br></div><div>I think that there might be a couple of issues in key_chain.cc.</div><div><br></div><div>In file key_chain.cc, the line</div><div><br></div><div>if(err = SecItemImport(data, NULL, &type, &format, 0, &params, NULL, &items) == errSecSuccess)</div><div><br></div><div>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.<br><br>Also, the â€‹documentation for SecItemImport (at <a href="https://developer.apple.com/library/mac/documentation/security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/uid/TP30000898-CH1g-SW49">https://developer.apple.com/library/mac/documentation/security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/uid/TP30000898-CH1g-SW49</a>) shows that the sequence of parameters &type and &format is wrong. I reversed them.<br><br>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.<br><br>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.</div><div><br></div><div>I have no idea why this was a problem for me and not for others.</div><div><br></div><div>The diff:<br><br><br><div>*** /tmp/key_chain.cc<span class="Apple-tab-span" style="white-space:pre">   </span>2014-06-12 15:55:45.000000000 +1000</div><div>--- /tmp/key_chain.cc_orig<span class="Apple-tab-span" style="white-space:pre">        </span>2014-06-12 15:55:45.000000000 +1000</div><div>***************</div><div>*** 31,56 ****</div><div>  <span class="Apple-tab-span" style="white-space:pre">        </span>bool res = false;</div><div>  </div><div>  <span class="Apple-tab-span" style="white-space:pre">  </span>SecItemImportExportKeyParameters params = { .keyUsage = NULL, .keyAttributes = NULL };</div><div>! <span class="Apple-tab-span" style="white-space:pre">     </span>/*****************************************************</div><div>! <span class="Apple-tab-span" style="white-space:pre">     </span>/* Specifying the expected Item Type and Format</div><div>! <span class="Apple-tab-span" style="white-space:pre">    </span> * caused SecItemImport to return </div><div>! <span class="Apple-tab-span" style="white-space:pre">    </span> * errSecAddinLoadFailed.</div><div>! <span class="Apple-tab-span" style="white-space:pre">  </span> * I didn't check whether it was due to both being</div><div>! <span class="Apple-tab-span" style="white-space:pre"> </span> * specified or just one. Setting to the Unknown enum</div><div>! <span class="Apple-tab-span" style="white-space:pre">      </span> * worked.</div><div>! <span class="Apple-tab-span" style="white-space:pre"> </span> * Original code on next two comment lines.</div><div>! <span class="Apple-tab-span" style="white-space:pre">        </span>/* SecExternalItemType type = kSecItemTypePublicKey;</div><div>! <span class="Apple-tab-span" style="white-space:pre">       </span>/* SecExternalFormat format = kSecFormatPEMSequence;</div><div>! <span class="Apple-tab-span" style="white-space:pre">       </span> * Updated code with both vars set to unknown on next</div><div>! <span class="Apple-tab-span" style="white-space:pre">      </span> * two lines. */</div><div>! <span class="Apple-tab-span" style="white-space:pre">   </span>SecExternalFormat format = kSecFormatUnknown;</div><div>! <span class="Apple-tab-span" style="white-space:pre">      </span>SecExternalItemType type = kSecItemTypeUnknown;</div><div>  </div><div>  <span class="Apple-tab-span" style="white-space:pre">    </span>CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const UInt8*)_key_data.data(), _key_data.size(), kCFAllocatorNull);</div><div>  <span class="Apple-tab-span" style="white-space:pre">       </span>CFArrayRef items = NULL;</div><div>  <span class="Apple-tab-span" style="white-space:pre">      </span>OSStatus err;</div><div>! <span class="Apple-tab-span" style="white-space:pre">      </span>err = SecItemImport(data, NULL, &format, &type, 0, &params, NULL, &items);</div><div>! <span class="Apple-tab-span" style="white-space:pre"> </span>if(err == errSecSuccess)</div><div>  <span class="Apple-tab-span" style="white-space:pre">      </span>{</div><div>  <span class="Apple-tab-span" style="white-space:pre">             </span>_sec_key = (SecKeyRef)CFArrayGetValueAtIndex(items, 0);</div><div>  <span class="Apple-tab-span" style="white-space:pre">               </span>if(_sec_key != NULL)</div><div>--- 31,43 ----</div><div>  <span class="Apple-tab-span" style="white-space:pre">     </span>bool res = false;</div><div>  </div><div>  <span class="Apple-tab-span" style="white-space:pre">  </span>SecItemImportExportKeyParameters params = { .keyUsage = NULL, .keyAttributes = NULL };</div><div>! <span class="Apple-tab-span" style="white-space:pre">     </span>SecExternalItemType type = kSecItemTypePublicKey;</div><div>! <span class="Apple-tab-span" style="white-space:pre">  </span>SecExternalFormat format = kSecFormatPEMSequence;</div><div>  </div><div>  <span class="Apple-tab-span" style="white-space:pre">  </span>CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const UInt8*)_key_data.data(), _key_data.size(), kCFAllocatorNull);</div><div>  <span class="Apple-tab-span" style="white-space:pre">       </span>CFArrayRef items = NULL;</div><div>  <span class="Apple-tab-span" style="white-space:pre">      </span>OSStatus err;</div><div>! <span class="Apple-tab-span" style="white-space:pre">      </span>if(err = SecItemImport(data, NULL, &type, &format, 0, &params, NULL, &items) == errSecSuccess)</div><div>  <span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div>  <span class="Apple-tab-span" style="white-space:pre">             </span>_sec_key = (SecKeyRef)CFArrayGetValueAtIndex(items, 0);</div><div>  <span class="Apple-tab-span" style="white-space:pre">               </span>if(_sec_key != NULL)</div><div><br></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br>regards - David<br><br><br></div></span></span>
</div>
<br></div></div></body></html>