ObjOpenSSL  Diff

Differences From Artifact [694ef5d705]:

To Artifact [ecdf1a6c2b]:


394
395
396
397
398
399
400

401

402
403
404
405
406
407
408
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]
		ret = [X509OID stringWithUTF8String: buffer];
		    initWithUTF8String: buffer] autorelease];
	} @finally {
		[self freeMemory: buffer];
	}

	return ret;
}

421
422
423
424
425
426
427




















428
429
430
431

432
433



















434
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(s->cString, 1), 0);
	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