ObjOpenSSL  Check-in [3344395fc1]

Overview
Comment:Update to work with OFString changes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3344395fc1978313477bad5d8a0b564e23420494cc919796e840aa493eeedd8d
User & Date: florob@babelmonkeys.de on 2011-11-20 20:27:34
Other Links: manifest | tags
Context
2011-12-21
20:02
Store objects in variables of proper type check-in: 1325ff2574 user: florob@babelmonkeys.de tags: trunk
2011-11-20
20:27
Update to work with OFString changes check-in: 3344395fc1 user: florob@babelmonkeys.de tags: trunk
2011-11-04
19:45
Cleanup and fix X509Certificate. check-in: 81cee980ef user: js tags: trunk
Changes

Modified src/X509Certificate.h from [d580acb74e] to [8a5aff75c2].

63
64
65
66
67
68
69
70



71
- (BOOL)X509_isAssertedDomain: (OFString*)asserted
		  equalDomain: (OFString*)domain;
- (OFDictionary*)X509_dictionaryFromX509Name: (X509_NAME*)name;
- (OFString*)X509_stringFromASN1Object: (ASN1_OBJECT*)obj;
- (OFString*)X509_stringFromASN1String: (ASN1_STRING*)str;
@end

@interface X509OID: OFString {}



@end







|
>
>
>

63
64
65
66
67
68
69
70
71
72
73
74
- (BOOL)X509_isAssertedDomain: (OFString*)asserted
		  equalDomain: (OFString*)domain;
- (OFDictionary*)X509_dictionaryFromX509Name: (X509_NAME*)name;
- (OFString*)X509_stringFromASN1Object: (ASN1_OBJECT*)obj;
- (OFString*)X509_stringFromASN1String: (ASN1_STRING*)str;
@end

@interface X509OID: OFObject <OFCopying>
{
	OFString *string;
}
@end

Modified src/X509Certificate.m from [694ef5d705] to [ecdf1a6c2b].

394
395
396
397
398
399
400

401
402
403
404
405
406
407
408
		while ((length = OBJ_obj2txt(buffer, bufferLength, object,
		    1)) > bufferLength) {
			bufferLength = length;
			buffer = [self resizeMemory: buffer
					     toSize: bufferLength];
		}


		ret = [X509OID stringWithUTF8String: buffer];
	} @finally {
		[self freeMemory: buffer];
	}

	return ret;
}








>
|







394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
		while ((length = OBJ_obj2txt(buffer, bufferLength, object,
		    1)) > bufferLength) {
			bufferLength = length;
			buffer = [self resizeMemory: buffer
					     toSize: bufferLength];
		}

		ret = [[[X509OID alloc]
		    initWithUTF8String: buffer] autorelease];
	} @finally {
		[self freeMemory: buffer];
	}

	return ret;
}

421
422
423
424
425
426
427




















428
429
430
431
432
433



















434
	}

	return ret;
}
@end

@implementation X509OID




















- (OFString*)description
{
	char tmp[1024];
	OBJ_obj2txt(tmp, sizeof(tmp), OBJ_txt2obj(s->cString, 1), 0);
	return [OFString stringWithUTF8String: tmp];
}



















@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
	}

	return ret;
}
@end

@implementation X509OID
- initWithUTF8String: (const char*) str
{
	self = [self init];

	@try {
		string = [[OFString alloc] initWithUTF8String: str];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[string release];
	[super dealloc];
}

- (OFString*)description
{
	char tmp[1024];
	OBJ_obj2txt(tmp, sizeof(tmp), OBJ_txt2obj([string UTF8String], 1), 0);
	return [OFString stringWithUTF8String: tmp];
}

- (BOOL)isEqual: (id)object
{
	if (([object isKindOfClass: [OFString class]]) ||
	    ([object isKindOfClass: [X509OID class]]))
		return [object isEqual: string];

	return NO;
}

- (uint32_t)hash
{
	return [string hash];
}

- copy
{
	return [self retain];
}
@end