Index: ObjOpenSSL.oc.in ================================================================== --- ObjOpenSSL.oc.in +++ ObjOpenSSL.oc.in @@ -1,3 +1,3 @@ -package_description 1 +package_format 1 CPPFLAGS="$CPPFLAGS @OPENSSL_CPPFLAGS@" LIBS="-lobjopenssl @OPENSSL_LIBS@ $LIBS" Index: src/X509Certificate.m ================================================================== --- src/X509Certificate.m +++ src/X509Certificate.m @@ -33,11 +33,10 @@ # pragma clang diagnostic pop #endif #import "X509Certificate.h" -#import #import #import #import #import #import @@ -69,20 +68,20 @@ - initWithFile: (OFString *)path { self = [super init]; @try { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); OFData *data = [OFData dataWithContentsOfFile: path]; const unsigned char *dataItems = data.items; _certificate = d2i_X509(NULL, &dataItems, data.count); if (_certificate == NULL) @throw [OFInitializationFailedException exceptionWithClass: self.class]; - [pool release]; + objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } @@ -159,23 +158,22 @@ return _subject; } - (OFDictionary *)subjectAlternativeName { - OFAutoreleasePool *pool; OFMutableDictionary *ret; int i; if (_subjectAlternativeName != nil) return [[_subjectAlternativeName copy] autorelease]; ret = [OFMutableDictionary dictionary]; - pool = [[OFAutoreleasePool alloc] init]; i = -1; while ((i = X509_get_ext_by_NID(_certificate, NID_subject_alt_name, i)) != -1) { + void *pool = objc_autoreleasePoolPush(); X509_EXTENSION *extension; STACK_OF(GENERAL_NAME) *values; int j, count; if ((extension = X509_get_ext(_certificate, i)) == NULL) @@ -269,59 +267,58 @@ break; } } i++; /* Next extension */ - [pool releaseObjects]; + objc_autoreleasePoolPop(pool); } - [pool release]; [ret makeImmutable]; _subjectAlternativeName = [ret retain]; return ret; } - (bool)hasCommonNameMatchingDomain: (OFString *)domain { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); for (OFString *name in [[self subject] objectForKey: OID_commonName]) { if ([self X509_isAssertedDomain: name equalDomain: domain]) { - [pool release]; + objc_autoreleasePoolPop(pool); return true; } } - [pool release]; + objc_autoreleasePoolPop(pool); return false; } - (bool)hasDNSNameMatchingDomain: (OFString *)domain { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); for (OFString *name in [[self subjectAlternativeName] objectForKey: @"dNSName"]) { if ([self X509_isAssertedDomain: name equalDomain: domain]) { - [pool release]; + objc_autoreleasePoolPop(pool); return true; } } - [pool release]; + objc_autoreleasePoolPop(pool); return false; } - (bool)hasSRVNameMatchingDomain: (OFString *)domain service: (OFString *)service { size_t serviceLength; - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); OFDictionary *SANs = self.subjectAlternativeName; OFList *assertedNames = [[SANs objectForKey: @"otherName"] objectForKey: OID_SRVName]; if (![service hasPrefix: @"_"]) @@ -335,17 +332,17 @@ OFString *asserted; asserted = [name substringWithRange: of_range( serviceLength, name.length - serviceLength)]; if ([self X509_isAssertedDomain: asserted equalDomain: domain]) { - [pool release]; + objc_autoreleasePoolPop(pool); return true; } } } - [pool release]; + objc_autoreleasePoolPop(pool); return false; } - (bool)X509_isAssertedDomain: (OFString *)asserted equalDomain: (OFString *)domain @@ -382,14 +379,14 @@ } - (OFDictionary *)X509_dictionaryFromX509Name: (X509_NAME *)name { OFMutableDictionary *dict = [OFMutableDictionary dictionary]; - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; int i, count = X509_NAME_entry_count(name); for (i = 0; i < count; i++) { + void *pool = objc_autoreleasePoolPush(); 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); @@ -400,15 +397,13 @@ forKey: key]; value = [self X509_stringFromASN1String: str]; [[dict objectForKey: key] appendObject: value]; - [pool releaseObjects]; + objc_autoreleasePoolPop(pool); } - [pool release]; - [dict makeImmutable]; return dict; }