Overview
Comment: | Replace OFASN1Integer with long long OFNumber |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | asn1 |
Files: | files | file ages | folders |
SHA3-256: |
523aea1c7b3198eb4fb30833ddda5528 |
User & Date: | js on 2024-01-14 13:24:31 |
Other Links: | branch diff | manifest | tags |
Context
2024-01-14
| ||
15:46 | Replace OFASN1UTF8String with OFString check-in: d11d5f38db user: js tags: asn1 | |
13:24 | Replace OFASN1Integer with long long OFNumber check-in: 523aea1c7b user: js tags: asn1 | |
13:00 | Replace OFASN1Boolean with bool OFNumber check-in: 90ee6a8373 user: js tags: asn1 | |
Changes
Modified src/Makefile from [fd6e700a0b] to [342a8fea9c].
︙ | ︙ | |||
10 11 12 13 14 15 16 | LIB_MAJOR = ${OBJFW_LIB_MAJOR} LIB_MINOR = ${OBJFW_LIB_MINOR} LIB_PATCH = ${OBJFW_LIB_PATCH} SRCS = OFASN1BitString.m \ OFASN1Enumerated.m \ OFASN1IA5String.m \ | < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | LIB_MAJOR = ${OBJFW_LIB_MAJOR} LIB_MINOR = ${OBJFW_LIB_MINOR} LIB_PATCH = ${OBJFW_LIB_PATCH} SRCS = OFASN1BitString.m \ OFASN1Enumerated.m \ OFASN1IA5String.m \ OFASN1NumericString.m \ OFASN1ObjectIdentifier.m \ OFASN1OctetString.m \ OFASN1PrintableString.m \ OFASN1UTF8String.m \ OFASN1Value.m \ OFApplication.m \ |
︙ | ︙ |
Deleted src/OFASN1Integer.h version [0c0ab89a54].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted src/OFASN1Integer.m version [8246828d88].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Modified src/OFData+ASN1DERParsing.m from [d08f994c7d] to [45ee836bae].
︙ | ︙ | |||
15 16 17 18 19 20 21 | #include "config.h" #import "OFData+ASN1DERParsing.h" #import "OFASN1BitString.h" #import "OFASN1Enumerated.h" #import "OFASN1IA5String.h" | < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include "config.h" #import "OFData+ASN1DERParsing.h" #import "OFASN1BitString.h" #import "OFASN1Enumerated.h" #import "OFASN1IA5String.h" #import "OFASN1NumericString.h" #import "OFASN1ObjectIdentifier.h" #import "OFASN1OctetString.h" #import "OFASN1PrintableString.h" #import "OFASN1UTF8String.h" #import "OFASN1Value.h" #import "OFArray.h" |
︙ | ︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 51 52 | enum { tagConstructedMask = 0x20 }; int _OFData_ASN1DERParsing_reference; static size_t parseObject(OFData *self, id *object, size_t depthLimit); static OFArray * parseSequence(OFData *contents, size_t depthLimit) { OFMutableArray *ret = [OFMutableArray array]; size_t count = contents.count; | > > > > > > > > > > > > > > > > > > > > > > > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | enum { tagConstructedMask = 0x20 }; int _OFData_ASN1DERParsing_reference; static size_t parseObject(OFData *self, id *object, size_t depthLimit); long long OFASN1DERIntegerParse(const unsigned char *buffer, size_t length) { unsigned long long value = 0; /* TODO: Support for big numbers */ if (length > sizeof(unsigned long long) && (length != sizeof(unsigned long long) + 1 || buffer[0] != 0)) @throw [OFOutOfRangeException exception]; if (length >= 2 && ((buffer[0] == 0 && !(buffer[1] & 0x80)) || (buffer[0] == 0xFF && buffer[1] & 0x80))) @throw [OFInvalidFormatException exception]; if (length >= 1 && buffer[0] & 0x80) value = ~0ull; while (length--) value = (value << 8) | *buffer++; return value; } static OFArray * parseSequence(OFData *contents, size_t depthLimit) { OFMutableArray *ret = [OFMutableArray array]; size_t count = contents.count; |
︙ | ︙ | |||
172 173 174 175 176 177 178 | if (boolValue != 0 && boolValue != 0xFF) @throw [OFInvalidFormatException exception]; *object = [OFNumber numberWithBool: boolValue]; return bytesConsumed; case OFASN1TagNumberInteger: | > > | > > | | 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | if (boolValue != 0 && boolValue != 0xFF) @throw [OFInvalidFormatException exception]; *object = [OFNumber numberWithBool: boolValue]; return bytesConsumed; case OFASN1TagNumberInteger: if (tag & tagConstructedMask) @throw [OFInvalidFormatException exception]; *object = [OFNumber numberWithLongLong: OFASN1DERIntegerParse(contents.items, contents.count)]; return bytesConsumed; case OFASN1TagNumberBitString: valueClass = [OFASN1BitString class]; break; case OFASN1TagNumberOctetString: valueClass = [OFASN1OctetString class]; break; case OFASN1TagNumberNull: |
︙ | ︙ |
Modified src/ObjFW.h from [72efcf8773] to [6948577d81].
︙ | ︙ | |||
143 144 145 146 147 148 149 | #ifdef OF_WINDOWS # import "OFWindowsRegistryKey.h" #endif #import "OFASN1BitString.h" #import "OFASN1Enumerated.h" #import "OFASN1IA5String.h" | < | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | #ifdef OF_WINDOWS # import "OFWindowsRegistryKey.h" #endif #import "OFASN1BitString.h" #import "OFASN1Enumerated.h" #import "OFASN1IA5String.h" #import "OFASN1NumericString.h" #import "OFASN1ObjectIdentifier.h" #import "OFASN1OctetString.h" #import "OFASN1PrintableString.h" #import "OFASN1UTF8String.h" #import "OFASN1Value.h" |
︙ | ︙ |