Store objects in variables of proper type
This commit is contained in:
parent
bb74e6cfd8
commit
820f0a04d1
2 changed files with 13 additions and 10 deletions
|
@ -39,6 +39,13 @@
|
|||
|
||||
#define OID_SRVName @"1.3.6.1.5.5.7.8.7"
|
||||
|
||||
@interface X509OID: OFObject <OFCopying>
|
||||
{
|
||||
OFString *string;
|
||||
}
|
||||
- initWithUTF8String: (const char*) str;
|
||||
@end
|
||||
|
||||
@interface X509Certificate: OFObject
|
||||
{
|
||||
X509 *crt;
|
||||
|
@ -63,12 +70,7 @@
|
|||
- (BOOL)X509_isAssertedDomain: (OFString*)asserted
|
||||
equalDomain: (OFString*)domain;
|
||||
- (OFDictionary*)X509_dictionaryFromX509Name: (X509_NAME*)name;
|
||||
- (OFString*)X509_stringFromASN1Object: (ASN1_OBJECT*)obj;
|
||||
- (X509OID*)X509_stringFromASN1Object: (ASN1_OBJECT*)obj;
|
||||
- (OFString*)X509_stringFromASN1String: (ASN1_STRING*)str;
|
||||
@end
|
||||
|
||||
@interface X509OID: OFObject <OFCopying>
|
||||
{
|
||||
OFString *string;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
case GEN_OTHERNAME:;
|
||||
OTHERNAME *otherName = generalName->d.otherName;
|
||||
OFMutableDictionary *types;
|
||||
OFString *key;
|
||||
X509OID *key;
|
||||
|
||||
types = [ret objectForKey: @"otherName"];
|
||||
if (types == nil) {
|
||||
|
@ -361,7 +361,8 @@
|
|||
int i, count = X509_NAME_entry_count(name);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
OFString *key, *value;
|
||||
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);
|
||||
|
@ -384,9 +385,9 @@
|
|||
}
|
||||
|
||||
|
||||
- (OFString*)X509_stringFromASN1Object: (ASN1_OBJECT*)object
|
||||
- (X509OID*)X509_stringFromASN1Object: (ASN1_OBJECT*)object
|
||||
{
|
||||
OFString *ret;
|
||||
X509OID *ret;
|
||||
int length, bufferLength = 256;
|
||||
char *buffer = [self allocMemoryWithSize: bufferLength];
|
||||
|
||||
|
|
Reference in a new issue