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
}


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

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

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

	return ret;
}

- (OFString *)X509_stringFromASN1String: (ASN1_STRING *)str
{







|





<
|





|







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 = of_alloc(1, bufferLength);

	@try {
		while ((length = OBJ_obj2txt(buffer, bufferLength, object,
		    1)) > bufferLength) {
			bufferLength = length;

			buffer = of_realloc(buffer, 1, bufferLength);
		}

		ret = [[[X509OID alloc]
		    initWithUTF8String: buffer] autorelease];
	} @finally {
		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

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

	return false;
}

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

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







|









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;
}

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

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