English names of Keychain 4-char codes aren't looked up correctly on Intel systems. This is a minor issue, that only affects logging/debugging messages.
This happens because the related utility functions in SecurityUtils.m are converting the codes to strings in a way that only works on big-endian CPUs. I worked around this by adding a byte-swapping call to each function. Here's the patch:
--- /Hack/Others/Keychain/Frameworks/Keychain/Utilities/SecurityUtils.m (revision 449)
+++ /Hack/Others/Keychain/Frameworks/Keychain/Utilities/SecurityUtils.m (working copy)
@@ -60,30 +60,37 @@
}
NSString* nameOfAuthenticationTypeConstant(SecAuthenticationType type) {
+ type = EndianU32_NtoB(type);
return localizedStringWithFallback([NSString stringWithFormat:@"%-4.4s", (char*)(&type)], @"Authentication Type Constants");
}
NSString* nameOfAuthenticationType(SecAuthenticationType type) {
+ type = EndianU32_NtoB(type);
return localizedStringWithFallback([NSString stringWithFormat:@"%-4.4s", (char*)(&type)], @"Authentication Type Names");
}
NSString* nameOfProtocolConstant(SecProtocolType type) {
+ type = EndianU32_NtoB(type);
return localizedStringWithFallback([NSString stringWithFormat:@"%-4.4s", (char*)(&type)], @"Protocol Type Constants");
}
NSString* shortNameOfProtocol(SecProtocolType type) {
+ type = EndianU32_NtoB(type);
return localizedStringWithFallback([NSString stringWithFormat:@"%-4.4s", (char*)(&type)], @"Protocol Type Short Names");
}
NSString* longNameOfProtocol(SecProtocolType type) {
+ type = EndianU32_NtoB(type);
return localizedStringWithFallback([NSString stringWithFormat:@"%-4.4s", (char*)(&type)], @"Protocol Type Long Names");
}
NSString* nameOfKeychainAttributeConstant(SecKeychainAttrType type) {
+ type = EndianU32_NtoB(type);
return localizedStringWithFallback([NSString stringWithFormat:@"%-4.4s", (char*)(&type)], @"Keychain Attribute Type Constants");
}
NSString* nameOfKeychainAttribute(SecKeychainAttrType type) {
+ type = EndianU32_NtoB(type);
return localizedStringWithFallback([NSString stringWithFormat:@"%-4.4s", (char*)(&type)], @"Keychain Attribute Type Names");
}
Logged In: YES
user_id=735766
Originator: NO
Resolved in r453.