ObjOpenSSL  Diff

Differences From Artifact [a5faa63283]:

To Artifact [48c2a42784]:


412
413
414
415
416
417
418
419

420
421
422
423
424
425
426

427
428
429
430
431
432

433
434
435
436
437
438
439
412
413
414
415
416
417
418

419
420
421
422
423
424


425
426
427
428
429
430

431
432
433
434
435
436
437
438







-
+





-
-
+





-
+







}


- (X509OID *)X509_stringFromASN1Object: (ASN1_OBJECT *)object
{
	X509OID *ret;
	int length, bufferLength = 256;
	char *buffer = [self allocMemoryWithSize: bufferLength];
	char *buffer = of_alloc(1, bufferLength);

	@try {
		while ((length = OBJ_obj2txt(buffer, bufferLength, object,
		    1)) > bufferLength) {
			bufferLength = length;
			buffer = [self resizeMemory: buffer
					       size: bufferLength];
			buffer = of_realloc(buffer, 1, bufferLength);
		}

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

	return ret;
}

- (OFString *)X509_stringFromASN1String: (ASN1_STRING *)str
{
496
497
498
499
500
501
502
503

504
505
506
507
508
509
510
511
512
495
496
497
498
499
500
501

502
503
504
505
506
507
508
509
510
511







-
+










	if ([object isKindOfClass: [OFString class]])
		return [_string isEqual: object];

	return false;
}

- (uint32_t)hash
- (unsigned long)hash
{
	return _string.hash;
}

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