Index: src/X509Certificate.h ================================================================== --- src/X509Certificate.h +++ src/X509Certificate.h @@ -36,10 +36,17 @@ #define OID_streetAddress @"2.5.4.9" #define OID_organizationName @"2.5.4.10" #define OID_organizationalUnitName @"2.5.4.11" #define OID_SRVName @"1.3.6.1.5.5.7.8.7" + +@interface X509OID: OFObject +{ + OFString *string; +} +- initWithUTF8String: (const char*) str; +@end @interface X509Certificate: OFObject { X509 *crt; OFDictionary *issuer; @@ -61,14 +68,9 @@ - (BOOL)hasSRVNameMatchingDomain: (OFString*)domain service: (OFString*)service; - (BOOL)X509_isAssertedDomain: (OFString*)asserted equalDomain: (OFString*)domain; - (OFDictionary*)X509_dictionaryFromX509Name: (X509_NAME*)name; -- (OFString*)X509_stringFromASN1Object: (ASN1_OBJECT*)obj; +- (X509OID*)X509_stringFromASN1Object: (ASN1_OBJECT*)obj; - (OFString*)X509_stringFromASN1String: (ASN1_STRING*)str; @end -@interface X509OID: OFObject -{ - OFString *string; -} -@end Index: src/X509Certificate.m ================================================================== --- src/X509Certificate.m +++ src/X509Certificate.m @@ -161,11 +161,11 @@ switch(generalName->type) { case GEN_OTHERNAME:; OTHERNAME *otherName = generalName->d.otherName; OFMutableDictionary *types; - OFString *key; + X509OID *key; types = [ret objectForKey: @"otherName"]; if (types == nil) { types = [OFMutableDictionary dictionary]; @@ -359,11 +359,12 @@ OFMutableDictionary *dict = [OFMutableDictionary dictionary]; OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; int i, count = X509_NAME_entry_count(name); for (i = 0; i < count; i++) { - OFString *key, *value; + X509OID *key; + OFString *value; X509_NAME_ENTRY *entry = X509_NAME_get_entry(name, i); ASN1_OBJECT *obj = X509_NAME_ENTRY_get_object(entry); ASN1_STRING *str = X509_NAME_ENTRY_get_data(entry); key = [self X509_stringFromASN1Object: obj]; @@ -382,13 +383,13 @@ [dict makeImmutable]; return dict; } -- (OFString*)X509_stringFromASN1Object: (ASN1_OBJECT*)object +- (X509OID*)X509_stringFromASN1Object: (ASN1_OBJECT*)object { - OFString *ret; + X509OID *ret; int length, bufferLength = 256; char *buffer = [self allocMemoryWithSize: bufferLength]; @try { while ((length = OBJ_obj2txt(buffer, bufferLength, object,