ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-BER-XS/XS.xs
(Generate patch)

Comparing Convert-BER-XS/XS.xs (file contents):
Revision 1.15 by root, Sat Apr 20 15:23:26 2019 UTC vs.
Revision 1.23 by root, Sun Apr 21 01:51:12 2019 UTC

58 ASN_CLASS_SHIFT = 6, 58 ASN_CLASS_SHIFT = 6,
59 59
60 // ASN_APPLICATION SNMP 60 // ASN_APPLICATION SNMP
61 SNMP_IPADDRESS = 0x00, 61 SNMP_IPADDRESS = 0x00,
62 SNMP_COUNTER32 = 0x01, 62 SNMP_COUNTER32 = 0x01,
63 SNMP_GAUGE32 = 0x02,
63 SNMP_UNSIGNED32 = 0x02, 64 SNMP_UNSIGNED32 = 0x02,
64 SNMP_TIMETICKS = 0x03, 65 SNMP_TIMETICKS = 0x03,
65 SNMP_OPAQUE = 0x04, 66 SNMP_OPAQUE = 0x04,
66 SNMP_COUNTER64 = 0x06, 67 SNMP_COUNTER64 = 0x06,
67}; 68};
80 BER_TYPE_IPADDRESS, 81 BER_TYPE_IPADDRESS,
81 BER_TYPE_CROAK, 82 BER_TYPE_CROAK,
82}; 83};
83 84
84enum { 85enum {
85 BER_CLASS = 0, 86 BER_CLASS = 0,
86 BER_TAG = 1, 87 BER_TAG = 1,
87 BER_CONSTRUCTED = 2, 88 BER_FLAGS = 2,
88 BER_DATA = 3, 89 BER_DATA = 3,
89 BER_ARRAYSIZE 90 BER_ARRAYSIZE
90}; 91};
91 92
92#define MAX_OID_STRLEN 4096 93#define MAX_OID_STRLEN 4096
93 94
252// get ber-encoded integer (i.e. pack "w") 253// get ber-encoded integer (i.e. pack "w")
253static UV 254static UV
254get_w (void) 255get_w (void)
255{ 256{
256 UV res = 0; 257 UV res = 0;
258 U8 c = get_u8 ();
259
260 if (expect_false (c == 0x80))
261 error ("illegal BER padding (X.690 8.1.2.4.2, 8.19.2)");
257 262
258 for (;;) 263 for (;;)
259 { 264 {
260 U8 c = get_u8 (); 265 if (expect_false (res >> UVSIZE * 8 - 7))
266 error ("BER variable integer overflow");
267
261 res = (res << 7) | (c & 0x7f); 268 res = (res << 7) | (c & 0x7f);
262 269
263 if (!(c & 0x80)) 270 if (!(c & 0x80))
264 return res; 271 return res;
272
273 c = get_u8 ();
265 } 274 }
266} 275}
267 276
268static UV 277static UV
269get_length (void) 278get_length (void)
277 286
278 switch (cnt) 287 switch (cnt)
279 { 288 {
280 case 0: 289 case 0:
281 error ("indefinite ASN.1 lengths not supported"); 290 error ("indefinite ASN.1 lengths not supported");
282 return 0; 291
292 case 0x7f:
293 error ("ASN.1 reserved value in length (X.690 8.1.3.5)");
283 294
284 default: 295 default:
285 error ("ASN.1 length too long"); 296 error ("ASN.1 length too long (only up to 2**64 octets supported)");
286 return 0;
287 297
288 case 8: res = (res << 8) | get_u8 (); 298 case 8: res = (res << 8) | get_u8 ();
289 case 7: res = (res << 8) | get_u8 (); 299 case 7: res = (res << 8) | get_u8 ();
290 case 6: res = (res << 8) | get_u8 (); 300 case 6: res = (res << 8) | get_u8 ();
291 case 5: res = (res << 8) | get_u8 (); 301 case 5: res = (res << 8) | get_u8 ();
303decode_int (void) 313decode_int (void)
304{ 314{
305 UV len = get_length (); 315 UV len = get_length ();
306 316
307 if (!len) 317 if (!len)
308 {
309 error ("invalid integer length equal to zero"); 318 error ("invalid integer length equal to zero (X.690 8.3.1)");
310 return 0;
311 }
312 319
313 U8 *data = get_n (len); 320 U8 *data = get_n (len);
314 321
322 if (expect_false (len > 1))
323 {
324 U16 mask = (data [0] << 8) | data [1] & 0xff80;
325
326 if (expect_false (mask == 0xff80 || mask == 0x0000))
327 error ("illegal padding in integer (X.690 8.3.2)");
328 }
329
315 int negative = data [0] & 0x80; 330 int negative = data [0] & 0x80;
316 331
317 UV val = negative ? -1 : 0; // copy signbit to all bits 332 UV val = negative ? -1 : 0; // copy signbit to all bits
333
334 if (len > UVSIZE + (!negative && !*data))
335 //printf ("len %d > %d + (!%d && !%d) = %d\n", len, UVSIZE, negative, *data, UVSIZE + (!negative && !*data));//D
336 error ("INTEGER overflow");
318 337
319 do 338 do
320 val = (val << 8) | *data++; 339 val = (val << 8) | *data++;
321 while (--len); 340 while (--len);
322 341
377 } 396 }
378 397
379 U8 *end = cur + len; 398 U8 *end = cur + len;
380 UV w = get_w (); 399 UV w = get_w ();
381 400
382 static char oid[MAX_OID_STRLEN]; // static, becaueds too large for stack 401 static char oid[MAX_OID_STRLEN]; // static, because too large for stack
383 char *app = oid; 402 char *app = oid;
384 403
385 if (relative) 404 if (relative)
386 app = write_uv (app, w); 405 app = write_uv (app, w);
387 else 406 else if (w < 2 * 40)
388 { 407 {
389 app = write_uv (app, (U8)w / 40); 408 app = write_uv (app, (U8)w / 40);
390 *app++ = '.'; 409 *app++ = '.';
391 app = write_uv (app, (U8)w % 40); 410 app = write_uv (app, (U8)w % 40);
411 }
412 else
413 {
414 app = write_uv (app, 2);
415 *app++ = '.';
416 app = write_uv (app, w - 2 * 40);
392 } 417 }
393 418
394 while (cur < end) 419 while (cur < end)
395 { 420 {
396 // we assume an oid component is never > 64 digits 421 // we assume an oid component is never > 64 digits
453 int tag = identifier & ASN_TAG_MASK; 478 int tag = identifier & ASN_TAG_MASK;
454 479
455 if (tag == ASN_TAG_BER) 480 if (tag == ASN_TAG_BER)
456 tag = get_w (); 481 tag = get_w ();
457 482
458 if (tag == ASN_TAG_BER)
459 tag = get_w ();
460
461 if (constructed) 483 if (constructed)
462 { 484 {
463 UV len = get_length (); 485 UV len = get_length ();
464 UV seqend = (cur - buf) + len; 486 UV seqend = (cur - buf) + len;
465 AV *av = (AV *)sv_2mortal ((SV *)newAV ()); 487 AV *av = (AV *)sv_2mortal ((SV *)newAV ());
466 488
467 while (cur < buf + seqend) 489 while (cur < buf + seqend)
468 av_push (av, decode_ber ()); 490 av_push (av, decode_ber ());
469 491
470 if (cur > buf + seqend) 492 if (cur > buf + seqend)
471 croak ("constructed type %02x overflow (%x %x)\n", identifier, cur - buf, seqend); 493 croak ("constructed type %02x length overflow (0x%x 0x%x)\n", identifier, (int)(cur - buf), (int)seqend);
472 494
473 res = newRV_inc ((SV *)av); 495 res = newRV_inc ((SV *)av);
474 } 496 }
475 else 497 else
476 switch (profile_lookup (cur_profile, klass, tag)) 498 switch (profile_lookup (cur_profile, klass, tag))
478 case BER_TYPE_NULL: 500 case BER_TYPE_NULL:
479 { 501 {
480 UV len = get_length (); 502 UV len = get_length ();
481 503
482 if (len) 504 if (len)
483 croak ("BER_TYPE_NULL value with non-zero length %d encountered", len); 505 croak ("BER_TYPE_NULL value with non-zero length %d encountered (X.690 8.8.2)", len);
484 506
485 res = &PL_sv_undef; 507 res = &PL_sv_undef;
486 } 508 }
487 break; 509 break;
488 510
489 case BER_TYPE_BOOL: 511 case BER_TYPE_BOOL:
490 { 512 {
491 UV len = get_length (); 513 UV len = get_length ();
492 514
493 if (len != 1) 515 if (len != 1)
494 croak ("BER_TYPE_BOOLEAN value with invalid length %d encountered", len); 516 croak ("BER_TYPE_BOOLEAN value with invalid length %d encountered (X.690 8.2.1)", len);
495 517
496 res = newSVcacheint (!!get_u8 ()); 518 res = newSVcacheint (!!get_u8 ());
497 } 519 }
498 break; 520 break;
499 521
521 case BER_TYPE_IPADDRESS: 543 case BER_TYPE_IPADDRESS:
522 { 544 {
523 UV len = get_length (); 545 UV len = get_length ();
524 546
525 if (len != 4) 547 if (len != 4)
526 croak ("BER_TYPE_IPADDRESS type with invalid length %d encountered", len); 548 croak ("BER_TYPE_IPADDRESS type with invalid length %d encountered (RFC 2578 7.1.5)", len);
527 549
528 U8 c1 = get_u8 (); 550 U8 c1 = get_u8 ();
529 U8 c2 = get_u8 (); 551 U8 c2 = get_u8 ();
530 U8 c3 = get_u8 (); 552 U8 c3 = get_u8 ();
531 U8 c4 = get_u8 (); 553 U8 c4 = get_u8 ();
548 croak ("unconfigured/unsupported class/tag %d/%d", klass, tag); 570 croak ("unconfigured/unsupported class/tag %d/%d", klass, tag);
549 } 571 }
550 572
551 AV *av = newAV (); 573 AV *av = newAV ();
552 av_fill (av, BER_ARRAYSIZE - 1); 574 av_fill (av, BER_ARRAYSIZE - 1);
553 AvARRAY (av)[BER_CLASS ] = newSVcacheint (klass); 575 AvARRAY (av)[BER_CLASS] = newSVcacheint (klass);
554 AvARRAY (av)[BER_TAG ] = newSVcacheint (tag); 576 AvARRAY (av)[BER_TAG ] = newSVcacheint (tag);
555 AvARRAY (av)[BER_CONSTRUCTED] = newSVcacheint (constructed ? 1 : 0); 577 AvARRAY (av)[BER_FLAGS] = newSVcacheint (constructed ? 1 : 0);
556 AvARRAY (av)[BER_DATA ] = res; 578 AvARRAY (av)[BER_DATA ] = res;
557 579
558 return newRV_noinc ((SV *)av); 580 return newRV_noinc ((SV *)av);
559} 581}
560 582
561///////////////////////////////////////////////////////////////////////////// 583/////////////////////////////////////////////////////////////////////////////
566strlen_sum (STRLEN l1, STRLEN l2) 588strlen_sum (STRLEN l1, STRLEN l2)
567{ 589{
568 size_t sum = l1 + l2; 590 size_t sum = l1 + l2;
569 591
570 if (sum < (size_t)l2 || sum != (size_t)(STRLEN)sum) 592 if (sum < (size_t)l2 || sum != (size_t)(STRLEN)sum)
571 croak ("JSON::XS: string size overflow"); 593 croak ("Convert::BER::XS: string size overflow");
572 594
573 return sum; 595 return sum;
574} 596}
575 597
576static void 598static void
881{ 903{
882 AV *av = ber_tuple (tuple); 904 AV *av = ber_tuple (tuple);
883 905
884 int klass = SvIV (AvARRAY (av)[BER_CLASS]); 906 int klass = SvIV (AvARRAY (av)[BER_CLASS]);
885 int tag = SvIV (AvARRAY (av)[BER_TAG]); 907 int tag = SvIV (AvARRAY (av)[BER_TAG]);
886 int constructed = SvIV (AvARRAY (av)[BER_CONSTRUCTED]) ? ASN_CONSTRUCTED : 0; 908 int constructed = SvIV (AvARRAY (av)[BER_FLAGS]) & 1 ? ASN_CONSTRUCTED : 0;
887 SV *data = AvARRAY (av)[BER_DATA]; 909 SV *data = AvARRAY (av)[BER_DATA];
888 910
889 int identifier = (klass << ASN_CLASS_SHIFT) | constructed; 911 int identifier = (klass << ASN_CLASS_SHIFT) | constructed;
890 912
891 if (expect_false (tag >= ASN_TAG_BER)) 913 if (expect_false (tag >= ASN_TAG_BER))
925 put_length (0); 947 put_length (0);
926 break; 948 break;
927 949
928 case BER_TYPE_BOOL: 950 case BER_TYPE_BOOL:
929 put_length (1); 951 put_length (1);
930 *cur++ = SvTRUE (data) ? 0xff : 0x00; 952 *cur++ = SvTRUE (data) ? 0xff : 0x00; // 0xff = DER/CER
931 break; 953 break;
932 954
933 case BER_TYPE_OID: 955 case BER_TYPE_OID:
934 encode_oid (data, 0); 956 encode_oid (data, 0);
935 break; 957 break;
1037 const_iv (ASN_CONTEXT) 1059 const_iv (ASN_CONTEXT)
1038 const_iv (ASN_PRIVATE) 1060 const_iv (ASN_PRIVATE)
1039 1061
1040 const_iv (BER_CLASS) 1062 const_iv (BER_CLASS)
1041 const_iv (BER_TAG) 1063 const_iv (BER_TAG)
1042 const_iv (BER_CONSTRUCTED) 1064 const_iv (BER_FLAGS)
1043 const_iv (BER_DATA) 1065 const_iv (BER_DATA)
1044 1066
1045 const_iv (BER_TYPE_BYTES) 1067 const_iv (BER_TYPE_BYTES)
1046 const_iv (BER_TYPE_UTF8) 1068 const_iv (BER_TYPE_UTF8)
1047 const_iv (BER_TYPE_UCS2) 1069 const_iv (BER_TYPE_UCS2)
1055 const_iv (BER_TYPE_IPADDRESS) 1077 const_iv (BER_TYPE_IPADDRESS)
1056 const_iv (BER_TYPE_CROAK) 1078 const_iv (BER_TYPE_CROAK)
1057 1079
1058 const_iv (SNMP_IPADDRESS) 1080 const_iv (SNMP_IPADDRESS)
1059 const_iv (SNMP_COUNTER32) 1081 const_iv (SNMP_COUNTER32)
1082 const_iv (SNMP_GAUGE32)
1060 const_iv (SNMP_UNSIGNED32) 1083 const_iv (SNMP_UNSIGNED32)
1061 const_iv (SNMP_TIMETICKS) 1084 const_iv (SNMP_TIMETICKS)
1062 const_iv (SNMP_OPAQUE) 1085 const_iv (SNMP_OPAQUE)
1063 const_iv (SNMP_COUNTER64) 1086 const_iv (SNMP_COUNTER64)
1064 }; 1087 };
1065 1088
1066 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--) 1089 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--)
1067 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); 1090 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
1068} 1091}
1069 1092
1070SV * 1093void
1071ber_decode (SV *ber, SV *profile = &PL_sv_undef) 1094ber_decode (SV *ber, SV *profile = &PL_sv_undef)
1095 ALIAS:
1096 ber_decode_prefix = 1
1072 CODE: 1097 PPCODE:
1073{ 1098{
1074 cur_profile = SvPROFILE (profile); 1099 cur_profile = SvPROFILE (profile);
1075 STRLEN len; 1100 STRLEN len;
1076 buf = (U8 *)SvPVbyte (ber, len); 1101 buf = (U8 *)SvPVbyte (ber, len);
1077 cur = buf; 1102 cur = buf;
1078 end = buf + len; 1103 end = buf + len;
1079 1104
1080 RETVAL = decode_ber (); 1105 SV *tuple = decode_ber ();
1106
1107 EXTEND (SP, 2);
1108 PUSHs (sv_2mortal (tuple));
1109
1110 if (ix)
1111 PUSHs (sv_2mortal (newSViv (cur - buf)));
1112 else if (cur != end)
1113 error ("trailing garbage after BER data");
1081} 1114}
1082 OUTPUT: RETVAL
1083 1115
1084void 1116void
1085ber_is (SV *tuple, SV *klass = &PL_sv_undef, SV *tag = &PL_sv_undef, SV *constructed = &PL_sv_undef, SV *data = &PL_sv_undef) 1117ber_is (SV *tuple, SV *klass = &PL_sv_undef, SV *tag = &PL_sv_undef, SV *flags = &PL_sv_undef, SV *data = &PL_sv_undef)
1086 PPCODE: 1118 PPCODE:
1087{ 1119{
1088 if (!SvOK (tuple)) 1120 if (!SvOK (tuple))
1089 XSRETURN_NO; 1121 XSRETURN_NO;
1090 1122
1092 croak ("ber_is: tuple must be BER tuple (array-ref)"); 1124 croak ("ber_is: tuple must be BER tuple (array-ref)");
1093 1125
1094 AV *av = (AV *)SvRV (tuple); 1126 AV *av = (AV *)SvRV (tuple);
1095 1127
1096 XPUSHs ( 1128 XPUSHs (
1097 (!SvOK (klass) || SvIV (AvARRAY (av)[BER_CLASS ]) == SvIV (klass)) 1129 (!SvOK (klass) || SvIV (AvARRAY (av)[BER_CLASS]) == SvIV (klass))
1098 && (!SvOK (tag) || SvIV (AvARRAY (av)[BER_TAG ]) == SvIV (tag)) 1130 && (!SvOK (tag) || SvIV (AvARRAY (av)[BER_TAG ]) == SvIV (tag))
1099 && (!SvOK (constructed) || !SvIV (AvARRAY (av)[BER_CONSTRUCTED]) == !SvIV (constructed)) 1131 && (!SvOK (flags) || !SvIV (AvARRAY (av)[BER_FLAGS]) == !SvIV (flags))
1100 && (!SvOK (data) || sv_eq (AvARRAY (av)[BER_DATA ], data)) 1132 && (!SvOK (data) || sv_eq (AvARRAY (av)[BER_DATA ], data))
1101 ? &PL_sv_yes : &PL_sv_undef); 1133 ? &PL_sv_yes : &PL_sv_undef);
1102} 1134}
1103 1135
1104void 1136void
1105ber_is_seq (SV *tuple) 1137ber_is_seq (SV *tuple)
1109 XSRETURN_UNDEF; 1141 XSRETURN_UNDEF;
1110 1142
1111 AV *av = ber_tuple (tuple); 1143 AV *av = ber_tuple (tuple);
1112 1144
1113 XPUSHs ( 1145 XPUSHs (
1114 SvIV (AvARRAY (av)[BER_CLASS ]) == ASN_UNIVERSAL 1146 SvIV (AvARRAY (av)[BER_CLASS]) == ASN_UNIVERSAL
1115 && SvIV (AvARRAY (av)[BER_TAG ]) == ASN_SEQUENCE 1147 && SvIV (AvARRAY (av)[BER_TAG ]) == ASN_SEQUENCE
1116 && SvIV (AvARRAY (av)[BER_CONSTRUCTED]) 1148 && SvIV (AvARRAY (av)[BER_FLAGS])
1117 ? AvARRAY (av)[BER_DATA] : &PL_sv_undef); 1149 ? AvARRAY (av)[BER_DATA] : &PL_sv_undef);
1118} 1150}
1119 1151
1120void 1152void
1121ber_is_int (SV *tuple, SV *value = &PL_sv_undef) 1153ber_is_int (SV *tuple, SV *value = &PL_sv_undef)
1127 AV *av = ber_tuple (tuple); 1159 AV *av = ber_tuple (tuple);
1128 1160
1129 UV data = SvUV (AvARRAY (av)[BER_DATA]); 1161 UV data = SvUV (AvARRAY (av)[BER_DATA]);
1130 1162
1131 XPUSHs ( 1163 XPUSHs (
1132 SvIV (AvARRAY (av)[BER_CLASS ]) == ASN_UNIVERSAL 1164 SvIV (AvARRAY (av)[BER_CLASS]) == ASN_UNIVERSAL
1133 && SvIV (AvARRAY (av)[BER_TAG ]) == ASN_INTEGER 1165 && SvIV (AvARRAY (av)[BER_TAG ]) == ASN_INTEGER
1134 && !SvIV (AvARRAY (av)[BER_CONSTRUCTED]) 1166 && !SvIV (AvARRAY (av)[BER_FLAGS])
1135 && (!SvOK (value) || data == SvUV (value)) 1167 && (!SvOK (value) || data == SvUV (value))
1136 ? sv_2mortal (data ? newSVsv (AvARRAY (av)[BER_DATA]) : newSVpv ("0 but true", 0)) 1168 ? sv_2mortal (data ? newSVsv (AvARRAY (av)[BER_DATA]) : newSVpv ("0 but true", 0))
1137 : &PL_sv_undef); 1169 : &PL_sv_undef);
1138} 1170}
1139 1171
1145 XSRETURN_NO; 1177 XSRETURN_NO;
1146 1178
1147 AV *av = ber_tuple (tuple); 1179 AV *av = ber_tuple (tuple);
1148 1180
1149 XPUSHs ( 1181 XPUSHs (
1150 SvIV (AvARRAY (av)[BER_CLASS ]) == ASN_UNIVERSAL 1182 SvIV (AvARRAY (av)[BER_CLASS]) == ASN_UNIVERSAL
1151 && SvIV (AvARRAY (av)[BER_TAG ]) == ASN_OBJECT_IDENTIFIER 1183 && SvIV (AvARRAY (av)[BER_TAG ]) == ASN_OBJECT_IDENTIFIER
1152 && !SvIV (AvARRAY (av)[BER_CONSTRUCTED]) 1184 && !SvIV (AvARRAY (av)[BER_FLAGS])
1153 && (!SvOK (oid) || sv_eq (AvARRAY (av)[BER_DATA], oid)) 1185 && (!SvOK (oid) || sv_eq (AvARRAY (av)[BER_DATA], oid))
1154 ? newSVsv (AvARRAY (av)[BER_DATA]) : &PL_sv_undef); 1186 ? newSVsv (AvARRAY (av)[BER_DATA]) : &PL_sv_undef);
1155} 1187}
1156 1188
1157############################################################################# 1189#############################################################################
1175ber_int (SV *sv) 1207ber_int (SV *sv)
1176 CODE: 1208 CODE:
1177{ 1209{
1178 AV *av = newAV (); 1210 AV *av = newAV ();
1179 av_fill (av, BER_ARRAYSIZE - 1); 1211 av_fill (av, BER_ARRAYSIZE - 1);
1180 AvARRAY (av)[BER_CLASS ] = newSVcacheint (ASN_UNIVERSAL); 1212 AvARRAY (av)[BER_CLASS] = newSVcacheint (ASN_UNIVERSAL);
1181 AvARRAY (av)[BER_TAG ] = newSVcacheint (ASN_INTEGER); 1213 AvARRAY (av)[BER_TAG ] = newSVcacheint (ASN_INTEGER);
1182 AvARRAY (av)[BER_CONSTRUCTED] = newSVcacheint (0); 1214 AvARRAY (av)[BER_FLAGS] = newSVcacheint (0);
1183 AvARRAY (av)[BER_DATA ] = newSVsv (sv); 1215 AvARRAY (av)[BER_DATA ] = newSVsv (sv);
1184 RETVAL = newRV_noinc ((SV *)av); 1216 RETVAL = newRV_noinc ((SV *)av);
1185} 1217}
1186 OUTPUT: RETVAL 1218 OUTPUT: RETVAL
1187 1219
1188# TODO: not arrayref, but elements? 1220# TODO: not arrayref, but elements?
1190ber_seq (SV *arrayref) 1222ber_seq (SV *arrayref)
1191 CODE: 1223 CODE:
1192{ 1224{
1193 AV *av = newAV (); 1225 AV *av = newAV ();
1194 av_fill (av, BER_ARRAYSIZE - 1); 1226 av_fill (av, BER_ARRAYSIZE - 1);
1195 AvARRAY (av)[BER_CLASS ] = newSVcacheint (ASN_UNIVERSAL); 1227 AvARRAY (av)[BER_CLASS] = newSVcacheint (ASN_UNIVERSAL);
1196 AvARRAY (av)[BER_TAG ] = newSVcacheint (ASN_SEQUENCE); 1228 AvARRAY (av)[BER_TAG ] = newSVcacheint (ASN_SEQUENCE);
1197 AvARRAY (av)[BER_CONSTRUCTED] = newSVcacheint (1); 1229 AvARRAY (av)[BER_FLAGS] = newSVcacheint (1);
1198 AvARRAY (av)[BER_DATA ] = newSVsv (arrayref); 1230 AvARRAY (av)[BER_DATA ] = newSVsv (arrayref);
1199 RETVAL = newRV_noinc ((SV *)av); 1231 RETVAL = newRV_noinc ((SV *)av);
1200} 1232}
1201 OUTPUT: RETVAL 1233 OUTPUT: RETVAL
1202 1234
1203MODULE = Convert::BER::XS PACKAGE = Convert::BER::XS::Profile 1235MODULE = Convert::BER::XS PACKAGE = Convert::BER::XS::Profile

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines