diff --git a/lib/modules/Standards.pmod/ASN1.pmod/Encode.pmod b/lib/modules/Standards.pmod/ASN1.pmod/Encode.pmod index 0f52d329dcfba09e99f7aaba4591d8443e4f05bd..50b183e6ff592364a30d27148b9961fcdbcb6d82 100644 --- a/lib/modules/Standards.pmod/ASN1.pmod/Encode.pmod +++ b/lib/modules/Standards.pmod/ASN1.pmod/Encode.pmod @@ -59,8 +59,7 @@ class asn1_object return sprintf("%c", len); string s = Gmp.mpz(len)->digits(256); if (strlen(s) >= 0x80) - throw( ({ "asn1.encode.asn1_object->encode_length: Max length exceeded.\n", - backtrace() }) ); + error( "asn1.encode.asn1_object->encode_length: Max length exceeded.\n" ); return sprintf("%c%s", strlen(s) | 0x80, s); } @@ -85,8 +84,7 @@ class asn1_compound elements = args; foreach(elements, mixed o) if (!o || !objectp(o)) - throw( ({ "asn1_compound: Non-object argument!\n", - backtrace() }) ); + error( "asn1_compound: Non-object argument!\n" ); WERROR(sprintf("asn1_compound: %O\n", elements)); } } @@ -183,8 +181,7 @@ class asn1_identifier if ( (sizeof(args) < 2) || (args[0] > 2) || (args[1] >= ( (args[0] < 2) ? 40 : 176) )) - throw( ({ "asn1.encode.asn1_identifier->create: Invalid object identifier.\n", - backtrace() }) ); + error( "asn1.encode.asn1_identifier->create: Invalid object identifier.\n" ); id = args; } diff --git a/lib/modules/Standards.pmod/ASN1.pmod/Types.pmod b/lib/modules/Standards.pmod/ASN1.pmod/Types.pmod index 563fabd4b3fea36980b19d1383e7829c2a9c92bc..4b888933a46df114eb7543cdd6fd56c404e27047 100644 --- a/lib/modules/Standards.pmod/ASN1.pmod/Types.pmod +++ b/lib/modules/Standards.pmod/ASN1.pmod/Types.pmod @@ -1,5 +1,5 @@ /* - * $Id: Types.pmod,v 1.17 2000/11/20 01:28:23 mast Exp $ + * $Id: Types.pmod,v 1.18 2002/03/17 18:23:58 nilsson Exp $ * * Encodes various asn.1 objects according to the Distinguished * Encoding Rules (DER) */ @@ -14,8 +14,6 @@ #define WERROR(x) #endif -#define error(msg) throw( ({ msg, backtrace() }) ) - /* Combines tag and class as a single integer, in a somewhat arbitrary * way. This works also for tags beyond 31 (although not for tags @@ -93,8 +91,7 @@ class asn1_object return sprintf("%c", len); string s = Gmp.mpz(len)->digits(256); if (strlen(s) >= 0x80) - throw( ({ "asn1.encode.asn1_object->encode_length: Max length exceeded.\n", - backtrace() }) ); + error( "asn1.encode.asn1_object->encode_length: Max length exceeded.\n" ); return sprintf("%c%s", strlen(s) | 0x80, s); } @@ -142,8 +139,7 @@ class asn1_compound elements = args; foreach(elements, mixed o) if (!o || !objectp(o)) - throw( ({ "asn1_compound: Non-object argument!\n", - backtrace() }) ); + error( "asn1_compound: Non-object argument!\n" ); WERROR(sprintf("asn1_compound: %O\n", elements)); return this_object(); } @@ -387,8 +383,7 @@ class asn1_identifier if ( (sizeof(args) < 2) || (args[0] > 2) || (args[1] >= ( (args[0] < 2) ? 40 : 176) )) - throw( ({ "asn1.encode.asn1_identifier->init: Invalid object identifier.\n", - backtrace() }) ); + error( "asn1.encode.asn1_identifier->init: Invalid object identifier.\n" ); id = args; return this_object(); } @@ -1006,14 +1001,12 @@ class asn1_universal_string string der_encode() { - throw (({"asn1_universal_string: Encoding not implemented\n", - backtrace()})); + error( "asn1_universal_string: Encoding not implemented\n" ); } object decode_primitive (string contents) { - throw (({"asn1_universal_string: Decoding not implemented\n", - backtrace()})); + error( "asn1_universal_string: Decoding not implemented\n" ); } } diff --git a/lib/modules/Standards.pmod/PKCS.pmod/Certificate.pmod b/lib/modules/Standards.pmod/PKCS.pmod/Certificate.pmod index 64cc95ccc352489cbf65e628ff3f92c96bf51e33..1b3fbea776207fefed9eeec1dffd2ad46071a692 100644 --- a/lib/modules/Standards.pmod/PKCS.pmod/Certificate.pmod +++ b/lib/modules/Standards.pmod/PKCS.pmod/Certificate.pmod @@ -144,9 +144,8 @@ class AttributeValueAssertion object value) { if (!types[type]) - throw( ({ sprintf("AttributeValueAssertion: " - "Unknown attribute type '%s'\n", - type), backtrace() }) ); + error( "AttributeValueAssertion: " + "Unknown attribute type '%s'\n", type ); ::create( ({ types[type], value }) ); } } @@ -186,9 +185,7 @@ class Attribute array(object) v) { if (!types[type]) - throw( ({ sprintf("Attribute: " - "Unknown attribute type '%s'\n", - type), backtrace() }) ); + error( "Attribute: Unknown attribute type '%s'\n", type); ::create( ({ types[type], asn1_set(v) }) ); } }