GithubHelp home page GithubHelp logo

gbarr / perl-convert-asn1 Goto Github PK

View Code? Open in Web Editor NEW
13.0 7.0 21.0 387 KB

encode/decode data using ASN.1 description

Home Page: http://search.cpan.org/dist/Convert-ASN1/

Perl 90.39% Yacc 9.61%

perl-convert-asn1's Introduction

Convert::ASN1

Convert::ASN1 is a perl library for encoding/decoding data using ASN.1 definitions

The ASN.1 parser is not a complete implementation of the ASN.1 specification. It has been built over time and features have been added on an as-needed basis.

Latest Release

The latest release can be found on http://www.cpan.org/ at http://search.cpan.org/dist/Convert-ASN1/

The documentation is at http://search.cpan.org/perldoc?Convert::ASN1

Installing

Install with your favorite CPAN install manager, eg

cpanm Convert::ASN1

If you do not have cpanm installed you can run

curl -s -L http://cpanmin.us | perl - Convert::ASN1

Contributing

Git

The preferred method of contribution is by forking a repository on github.

If you are not familiar with working with forked repositories please read http://help.github.com/fork-a-repo/ for details on how to setup your fork.

Try to avoid submitting to the master branch in your fork, it is useful to keep that following the main repository and if I decide to cherry-pick or fixup any commit you submit in a pull request you will have tracking issues later

To start a branch for fixes do the following, assuming you have the origin and upstream remotes setup as in the guide linked to above.

git fetch upstream git checkout -b mybranch upstream/master

this will checkout a new branch called mybranch from the latest code in the master branch of the upstream repository.

Once you have finished push that branch to your origin repository with

git push -u origin HEAD

The -u will setup branch tracking so if you later add more commits a simple

git push

is enough to push those commits.

Once you have pushed the branch to github, send a pull as described at http://help.github.com/send-pull-requests/

Dist::Zilla

The release is developed using Dist::Zilla

you will need to install

cpanm Dist::Zilla

once you have the base install of Dist::Zilla run

dzil authordeps --missing | cpanm dzil listdeps --missing | cpanm

perl-byacc

If you need to make changes to the parser then you will need to build perl-byacc1.8.2. You can fetch the source from perl-byacc1.8.2.tar.gz

With that built and available in your $PATH as byacc the parser can be compiled with

perl mkparse parser.y lib/Convert/ASN1/parser.pm

License

This software is copyright (c) 2000-2012 by Graham Barr.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

perl-convert-asn1's People

Contributors

alexmv avatar chrisridd avatar danaj avatar dsteinbrunner avatar fschlich avatar gbarr avatar gregoa avatar kentfredric avatar lpmi-13 avatar marschap avatar peter-mogensen avatar shlomif avatar timlegge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

perl-convert-asn1's Issues

Uninitialized value with ANY DEFINED BY

Use of uninitialized value in hash element at /usr/lib/perl5/site_perl/5.8.8/Convert/ASN1/_decode.pm line 133
The asn snipped:

    Attributes ::= SET OF Attribute
    Attribute ::= SEQUENCE {
      type   OBJECT IDENTIFIER,
      values SET OF ANY DEFINED BY type}

In this case, I'd called registertype( 'type', 'an OID', 'A macro'). But I didn't register all the OIDs that can be encountered.

I expected that the known (registered) OIDs would decode, and the others would be left raw (or ignored).

This is a pretty common use case with things like X.509 certs; one knows what's in the RFCs, but someone else will always provide input with a private extension. So one can't enumerate all the possible values. Or the value for most OIDs is simple, but some need special handling.

The alternative is to leave off the DEFINED BY and manually call find and decode. This works, but is more code.

In any case, Convert::ASN1 shouldn't complain about the uninitialized value...

Convert::ASN1 => 0.27

Length verification

In decoding "unsafe" data (submitted by an unknown user) against a valid ASN.1 description, I fell on an error.
If my buffer is padded with unnecessary data, the decoding parser tries to decode past the object, and can be stuck.

An actual example below.

#! /usr/bin/perl

use Convert::ASN1;

my $hexdata = 
"30 53 30 51 30 4f 30 4d 30 4b 30 09 06 05 2b 0e\
 03 02 1a 05 00 04 14 a0 72 0e a0 6a 7c 62 02 54\
 f2 a8 f5 9d d2 7b a4 f3 b7 2f a4 04 14 b0 b0 4a\
 fd 1c 75 28 f8 1c 61 aa 13 f6 fa c1 90 3d 6b 16\
 a3 02 12 11 21 bc 57 28 6f 30 08 db 49 63 f6 ae\
 89 3a de f6 d1 ff e0";
$hexdata =~ s/ //g;
$hexdata =~ s/\n//g;

# parse ASN.1 descriptions
my $asn = Convert::ASN1->new;
$asn->prepare(<<ASN1) or die "prepare: ", $asn->error;
   OCSPRequest     ::=     SEQUENCE {
       tbsRequest                  TBSRequest,
       optionalSignature   [0]     EXPLICIT ANY OPTIONAL }

   TBSRequest      ::=     SEQUENCE {
       version             [0]     EXPLICIT INTEGER OPTIONAL,
       requestorName       [1]     EXPLICIT ANY OPTIONAL,
       requestList                 SEQUENCE OF Request,
       requestExtensions   [2]     EXPLICIT ANY OPTIONAL }

   Request         ::=     SEQUENCE {
       reqCert                     CertID,
       singleRequestExtensions     [0] EXPLICIT ANY OPTIONAL }

   CertID          ::=     SEQUENCE {
       hashAlgorithm       ANY,
       issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
       issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
       serialNumber        INTEGER }
ASN1

my $asn_ocspreq = $asn->find('OCSPRequest');

my $OCSPREQDER = pack("H*", $hexdata);
my $ocspreq = $asn_ocspreq->decode($OCSPREQDER);
if (defined $ocspreq) {
  print "I got it\n";
}

The ->decode() call doesn't finish, and I think its caused by the extraneous 'ff e0' bytes (that could be the start of a very large object).

I can't avoid this extra data to happen, the module has already decoded the first object and could ignore the rest, and it could also return an error because there's not enough data ('ff e0' lacks 96 bytes just to encode the length).

memory leaks

i use Crypt::PKCS10, which caused some severe memory leaks from Convert::ASN1, which are partly caused by how that module uses it, i think, but could also be addressed in Convert::ASN1

please have a read of the PR and explanations here: openxpki/Crypt-PKCS10#8

asn_read is hung

asn_read is stuck when we disconnect the network connection between client and server.
IO:Socket is being used.
Using NET:LDAP version - 0.64
Using Convert:ASN - 0.27

We debugged the code and the hanging is happening at the point
NET:LDAP.pm ==> method process ==> line no 911
Conver:ASN1 IO.pm ==> method asn_read ==> line no 195

Can not decode my ASN it's written: decode error a6<=>30 0 8 at /Library/Perl/5.12/Convert/ASN1/_decode.pm line 113.

Hello Sir Graham,

I tried to use the Conver ASN module and stack with this error :
$VAR1 = undef;
ERROR: decode error a6<=>30 0 8 at /Library/Perl/5.12/Convert/ASN1/_decode.pm line 113

The complete of my script is:

!/usr/bin/perl

use Data::Dumper;
use Convert::ASN1 qw(:io :debug :tag :const);

CreateObJect#######;

$asn = Convert::ASN1->new;

#asn spec##########;

$specfile = "/Users/ahmadrifky/myscript/asn/myasnspec.txt";
$r = $asn->prepare_file($specfile);

Open File#### ;

my $file= $ARGV[0];
open my $fh, '<', $file or die "unable to open file '$file' for reading : $!";

Only Test

$nbytes = asn_read($fh, $data);
$yes = asn_ready($fh);
$aku = asn_dump($data);

print " yes $aku $nbytes \n";

$structure=$asn->decode($data) or print $asn->error();
print Dumper($asn->decode($data));

print "BEGIN SPECIFICATION:\n" if $DEBUG;

$asn->dump_all;

$asn->dump_op;

$asn->_hexdump($data);

print "END SPECIFICATION\n" if $DEBUG;

my $myresultcode = $asn->find("resultCode");

if (!defined($myresultcode)) { die "ERROR: " . $asn->error . "\n"; }

print "RRCTransactionIdentifier ", $myresultcode->decode($data) ;

the myasn.txt file is like this:

ChargingDataOutputRecord ::= CHOICE {
sCFPDPRecord SCFPDPRecord,
sCFSMSPSMORecord SCFSMSMORecord,
sCFSMSCSMORecord SCFSMSMORecord,
diameterCreditControlRecord DiameterCreditControlRecord,
fBCRatingRecord FBCRatingRecord,
rTCCreditControlRecord RTCCreditControlRecord,
onlineCreditControlRecord OnlineCreditControlRecord,
...
}
SCFPDPRecord ::= SEQUENCE {
chargingID ChargingID,
ggsnAddressUsed GSNAddress,
accessPointName AccessPointName OPTIONAL,
recordSequenceNumber RecordSequenceNumber,
nodeID NodeID,
localSequenceNumber LocalSequenceNumber,
lastPartialOutput BOOLEAN,
trafficCase TrafficCase OPTIONAL,
subscriberNumber AddressString OPTIONAL,
serviceClass ServiceClass OPTIONAL,
accountValueBefore MoneyAmount OPTIONAL,
accountValueAfter MoneyAmount OPTIONAL,
finalCharge MoneyAmount OPTIONAL,
chargedDuration ChargedDuration OPTIONAL,
cdrReason CdrReason,
teleServiceCode TeleServiceCode OPTIONAL,
startOfChargingOfContext TimeStamp OPTIONAL,
familyAndFriendsIndicator FamilyAndFriendsIndicator OPTIONAL,
numberOfSDPInterrogations NumberOfSDPInterrogations,
dataVolume DataVolume OPTIONAL,
currencyType CurrencyType OPTIONAL,
callingPartyNumber AddressString OPTIONAL,
originatingLocationInfo AddressString OPTIONAL,
accountNumber AddressString OPTIONAL,
terminatingLocationInfo AddressString OPTIONAL,
calledPartyNumber AddressString OPTIONAL,
accumulatorValueInfo SEQUENCE OF
AccumulatorValueInfo OPTIONAL,
dedicatedAccountInfo SEQUENCE OF
DedicatedAccountInfo OPTIONAL,
accountGroupID AccountGroupID OPTIONAL,
serviceOfferings ServiceOfferings OPTIONAL,
communityDataInfo SEQUENCE OF CommunityDataInfo OPTIONAL,
triggerTime TimeStamp OPTIONAL,
cellID CellID OPTIONAL,
locationAreaID LocationAreaID OPTIONAL,
categorizationInformation CategorizationInformation OPTIONAL,
ratedDurations RatedDurations OPTIONAL,
servedIMSI IMSI OPTIONAL,
...
}
SCFSMSMORecord ::= SEQUENCE {
servedIMSI IMSI,
servedMSISDN AddressString,
serviceCenter AddressString,
nodeID NodeID,
localSequenceNumber LocalSequenceNumber,
trafficCase TrafficCase OPTIONAL,
serviceClass ServiceClass OPTIONAL,
accountValueBefore MoneyAmount OPTIONAL,
accountValueAfter MoneyAmount OPTIONAL,
finalCharge MoneyAmount OPTIONAL,
cdrReason CdrReason,
teleServiceCode TeleServiceCode OPTIONAL,
startOfChargingOfEvent TimeStamp OPTIONAL,
familyAndFriendsIndicator FamilyAndFriendsIndicator OPTIONAL,
numberOfSDPInterrogations NumberOfSDPInterrogations,
currencyType CurrencyType OPTIONAL,
originatingLocationInfo AddressString OPTIONAL,
accountNumber AddressString OPTIONAL,
destinationNumber AddressString,
accumulatorValueInfo SEQUENCE OF
AccumulatorValueInfo OPTIONAL,
dedicatedAccountInfo SEQUENCE OF
DedicatedAccountInfo OPTIONAL,
eventTimeStamp TimeStamp,
networkID NetworkID OPTIONAL,
smsReferenceNumber CallReferenceNumber OPTIONAL,
mscAddress AddressString OPTIONAL,
sgsn-Number AddressString OPTIONAL,
accountGroupID AccountGroupID OPTIONAL,
serviceOfferings ServiceOfferings OPTIONAL,
communityDataInfo SEQUENCE OF CommunityDataInfo OPTIONAL,
calledPartyNumber AddressString OPTIONAL,
cellID CellID OPTIONAL,
locationAreaID LocationAreaID OPTIONAL,
categorizationInformation CategorizationInformation OPTIONAL,
ratedDurations RatedDurations OPTIONAL,
individualPriceFactorHistory IndividualPriceFactorHistory OPTIONAL,
-- PC 09943
originalCalledPartyNumber AddressString OPTIONAL,
-- PC 09943 end
...
}
DiameterCreditControlRecord ::= SEQUENCE {
cdrReason CdrReason,
nodeID NodeID,
recordSequenceNumber RecordSequenceNumber,
lastPartialOutput BOOLEAN,
trafficCase TrafficCase OPTIONAL,
teleServiceCode TeleServiceCode OPTIONAL,
subscriberID AddressString OPTIONAL,
callingPartyNumber AddressString OPTIONAL,
calledPartyNumber AddressString OPTIONAL,
triggerTime TimeStamp OPTIONAL,
chargedDuration ChargedDuration OPTIONAL,
dataVolume DataVolume OPTIONAL,
numberOfEvents NumberOfEvents OPTIONAL,
finalCharge MoneyAmount OPTIONAL,
accountValueBefore MoneyAmount OPTIONAL,
accountValueAfter MoneyAmount OPTIONAL,
sessionID SessionID,
userName UserName OPTIONAL,
numberOfSDPInterrogations NumberOfSDPInterrogations,
originRealm OriginRealm OPTIONAL,
originHost OriginHost OPTIONAL,
serviceClass ServiceClass OPTIONAL,
accountNumber AddressString OPTIONAL,
localSequenceNumber LocalSequenceNumber,
familyAndFriendsIndicator FamilyAndFriendsIndicator OPTIONAL,
currencyType CurrencyType OPTIONAL,
accumulatorValueInfo SEQUENCE OF AccumulatorValueInfo OPTIONAL,
dedicatedAccountInfo SEQUENCE OF DedicatedAccountInfo OPTIONAL,
serviceProviderID ServiceProviderID OPTIONAL,
extInt1 ExtInt OPTIONAL,
extInt2 ExtInt OPTIONAL,
extInt3 ExtInt OPTIONAL,
extInt4 ExtInt OPTIONAL,
extText ExtText OPTIONAL,
gprsQoS GPRSQoS OPTIONAL,
redirectingPartyNumber AddressString OPTIONAL,
originatingLocationInfo AddressString OPTIONAL,
terminatingLocationInfo AddressString OPTIONAL,
networkID NetworkID OPTIONAL,
subscriptionType SubscriptionType OPTIONAL,
smsDeliveryStatus SmsDeliveryStatus OPTIONAL,
calledPartyNumber2 AddressString OPTIONAL,
calledPartyNumber3 AddressString OPTIONAL,
radiusSessionID RadiusSessionID OPTIONAL,
multiSessionID MultiSessionID OPTIONAL,
originalSubscriptionIDData SubscriptionIDData OPTIONAL,
originalSubscriptionIDType SubscriptionIDType OPTIONAL,
accountingCorrelationID AccountingCorrelationID OPTIONAL,
abnormalTerminationReason AbnormalTerminationReason OPTIONAL,
accountGroupID AccountGroupID OPTIONAL,
serviceOfferings ServiceOfferings OPTIONAL,
communityDataInfo SEQUENCE OF CommunityDataInfo OPTIONAL,
usedAmountLastInterval MoneyAmount OPTIONAL,
deductedAmountLastInterval MoneyAmount OPTIONAL,
categorizationInformation CategorizationInformation OPTIONAL,
ratedDurations RatedDurations OPTIONAL,
...
}
FBCRatingRecord ::= SEQUENCE {
serviceClassInfo SEQUENCE OF ServiceClassInfo,
ggsnAddressUsed GSNAddress,
chargingID SEQUENCE OF ChargingID,
timeStamp TimeStamp,
volumeULAccumulatedTotal DataVolume,
volumeDLAccumulatedTotal DataVolume,
subscriberGroup SubscriberGroup,
nodeID NodeID,
localSequenceNumber LocalSequenceNumber,
servedIMSI IMSI OPTIONAL,
servedMSISDN AddressString OPTIONAL,
userName UserName OPTIONAL,
recoveryData RecoveryRecord OPTIONAL,
serviceClassExtendedInfo SEQUENCE OF
ServiceClassExtendedInfo OPTIONAL,
ratingRequested BOOLEAN OPTIONAL,
ratingSuccessful BOOLEAN OPTIONAL,
startOfUsageInfo SEQUENCE OF StartOfUsageInfo OPTIONAL,
...
}
RTCCreditControlRecord ::= SEQUENCE {
cdrReason CdrReason,
nodeID NodeID,
recordSequenceNumber RecordSequenceNumber,
lastPartialOutput BOOLEAN,
trafficCase TrafficCase OPTIONAL,
teleServiceCode TeleServiceCode OPTIONAL,
subscriberID AddressString OPTIONAL,
callingPartyNumber AddressString OPTIONAL,
calledPartyNumber AddressString OPTIONAL,
triggerTime TimeStamp OPTIONAL,
chargedDuration ChargedDuration OPTIONAL,
servedIMSI IMSI OPTIONAL,
numberOfEvents NumberOfEvents OPTIONAL,
finalCharge MoneyAmount OPTIONAL,
accountValueBefore MoneyAmount OPTIONAL,
accountValueAfter MoneyAmount OPTIONAL,
accountingCorrelationID AccountingCorrelationID,
numberOfSDPInterrogations NumberOfSDPInterrogations,
serviceClass ServiceClass OPTIONAL,
accountNumber AddressString OPTIONAL,
localSequenceNumber LocalSequenceNumber,
familyAndFriendsIndicator FamilyAndFriendsIndicator OPTIONAL,
currencyType CurrencyType OPTIONAL,
accumulatorValueInfo SEQUENCE OF
AccumulatorValueInfo OPTIONAL,
dedicatedAccountInfo SEQUENCE OF
DedicatedAccountInfo OPTIONAL,
redirectingPartyNumber AddressString OPTIONAL,
originatingLocationInfo AddressString OPTIONAL,
terminatingLocationInfo AddressString OPTIONAL,
networkID NetworkID OPTIONAL,
subscriptionType SubscriptionType OPTIONAL,
calledPartyNumber2 AddressString OPTIONAL,
calledPartyNumber3 AddressString OPTIONAL,
accountGroupID AccountGroupID OPTIONAL,
serviceOfferings ServiceOfferings OPTIONAL,
communityDataInfo SEQUENCE OF CommunityDataInfo OPTIONAL,
serviceCenter AddressString OPTIONAL,
startOfCharging TimeStamp OPTIONAL,
callSetUpResultCode CallSetUpResultCode OPTIONAL,
usedUnchargedDuration UsedUnchargedDuration OPTIONAL,
usedUnchargedEvent UsedUnchargedEvent OPTIONAL,
categorizationInformation CategorizationInformation OPTIONAL,
ratedDurations RatedDurations OPTIONAL,
individualPriceFactorHistory IndividualPriceFactorHistory OPTIONAL,
...
}
OnlineCreditControlRecord ::= SEQUENCE {
--- resultcode aslinya Unsigned32
resultCode INTEGER,
resultCodeExtension Unsigned32 OPTIONAL,
triggerTime TimeStamp OPTIONAL,
nodeName UTF8String,
serviceContextID UTF8String,
chargingContextID ChargingContext,
serviceSessionID UTF8String,
recordIdentificationNumber RecordIdentificationNumber,
partialSequenceNumber INTEGER OPTIONAL,
lastPartialOutput BOOLEAN OPTIONAL,
servedSubscriptionID SEQUENCE OF SubscriptionID OPTIONAL,
correlationID EXPLICIT CorrelationID OPTIONAL,
servingElement EXPLICIT ServingElement OPTIONAL,
creditControlRecords SEQUENCE OF SDPCreditControlRecord OPTIONAL,
usedUnchargedServiceUnits UsedServiceUnits OPTIONAL,
-- PC 07959
originalCalledPartyNumber AddressString OPTIONAL,
-- PC 07959 end
-- PC
chargedDuration UsedServiceUnits OPTIONAL,
usedStartPulses OCTET STRING OPTIONAL,
-- PC end
-- PC 08940
nonServedSubscriptionID UTF8String OPTIONAL,
-- PC 08940 end
authorizedQoS SEQUENCE OF AuthorizedQoS OPTIONAL,
-- PC 09687
firstCallInfo AddressString OPTIONAL,
-- PC 09687 end
--PC:08842
chargingSuppressionAtForwarding ChargingSuppressionAtForwarding OPTIONAL,
--PC:08842 end
--PC:10210
iMEI IMEI OPTIONAL,
trunkInformation TrunkInformation OPTIONAL,
-- PC:10210 end
-- PC:10064
authorizedChargingRules SEQUENCE OF AuthorizedChargingRules,
-- PC:10064 end
iMSChargingIdentifier IMSChargingIdentifier OPTIONAL,
--PC:09785
outgoingSessionId OutgoingSessionId OPTIONAL,
userSessionID UserSessionID OPTIONAL,
causeCode CauseCode OPTIONAL,
creditControlFailureHandling CreditControlFailureHandling OPTIONAL,
-- PC:09785 end
--PC:11040
accessPointName AccessPointName OPTIONAL,
dataVolume DataVolume OPTIONAL,
-- PC:11040 end
--PC:11376
receivedshortcodeNumber UTF8String OPTIONAL,
-- PC:11376 end
...
}

AbnormalTerminationReason ::= ENUMERATED {
serviceElementTermination (0),
connectionToUserBroken (1)
}
AccessPointName ::= OCTET STRING
AccountFlags ::= IA5String

AccountGroupID ::= INTEGER
-- 0 undefined
-- 1 - 2147483647 accountGroupID
AccountingCorrelationID ::= UTF8String
AccountUnitType ::= ENUMERATED
{
time(0),
money(1),
totalOctets(2),
inputOctets(3),
outputOctets(4),
serviceSpecificUnits(5),
volume(6)
}
AcctMultiSessionID ::= OCTET STRING
AccumulatorID ::= INTEGER
AccumulatorValue ::= INTEGER

Accumulator ::= SEQUENCE
{
accumulatorID AccumulatorID,
accumulatorBefore Integer32 OPTIONAL,
accumulatorChange Integer32,
accumulatorAfter Integer32,
accumulatorBeforeSession Integer32 OPTIONAL,
...
}

Accumulators ::= SEQUENCE OF Accumulator
AccountSpecifiedConsumption ::= CHOICE
{
dedicatedAccountSpecifiedConsumption DedicatedAccountSpecifiedConsumption,
mainAccountSpecifiedConsumption MainAccountSpecifiedConsumption,
specifiedConsumptionNoCost SpecifiedConsumptionNoCost,
...
}
AccumulatorSpecifiedConsumptions ::= SEQUENCE OF AccumulatorSpecifiedConsumption

AccumulatorSpecifiedConsumption ::= SEQUENCE
{
accumulatorID AccumulatorID,
accumulatorChange Integer32 OPTIONAL,
...
}

AccumulatorValueInfo ::= SEQUENCE {
accumulatorID AccumulatorID OPTIONAL,
accumulatorValue AccumulatorValue OPTIONAL,
accumulatorDeltaValue AccumulatorValue OPTIONAL,
...
}
AddressString ::= OCTET STRING
-- PC:10064
AuthorizedChargingRules ::= SEQUENCE {
triggerTime TimeStamp,
activatedChargingRuleName SEQUENCE OF ChargingRuleName OPTIONAL,
deactivatedChargingRuleName SEQUENCE OF ChargingRuleName OPTIONAL,
activatedChargingRuleBaseName SEQUENCE OF ChargingRuleBaseName,
deactivatedChargingRuleBaseName SEQUENCE OF ChargingRuleBaseName,
...
}
-- PC:10064 end
AuthorizedQoS ::= SEQUENCE {
triggerTime TimeStamp,
qoSClassIdentifier QoSClassIdentifier OPTIONAL,
maxRequestedBandwidthUL Unsigned32 OPTIONAL,
maxRequestedBandwidthDL Unsigned32 OPTIONAL,
priorityLevel PriorityLevel OPTIONAL,
preEmptionCapability BOOLEAN OPTIONAL,
preEmptionVulnerability BOOLEAN OPTIONAL,
...
}

BonusAdjustment ::= SEQUENCE
{
accountValueBefore MonetaryUnits OPTIONAL,
accountValueAfter MonetaryUnits OPTIONAL,
bonusAmount MonetaryUnits OPTIONAL,
accumulators Accumulators OPTIONAL,
dedicatedAccounts DedicatedAccounts OPTIONAL,
lifeCycleInformation LifeCycleInformation OPTIONAL,
-- PC
aggregatedValueBefore MonetaryUnits OPTIONAL,
aggregatedValueAfter MonetaryUnits OPTIONAL,
-- end PC
bonusOffers SEQUENCE OF BonusOffer OPTIONAL,
...
}

BonusOffer ::= SEQUENCE
{
offerID OfferID,
offerExpiryDateBefore Date OPTIONAL,
offerExpiryDateAfter Date OPTIONAL,
offerStartDateBefore Date OPTIONAL,
offerStartDateAfter Date OPTIONAL,
offerType OfferType OPTIONAL,
...
}

CallReferenceNumber ::= OCTET STRING
CallSetUpResultCode ::= ENUMERATED {
successful-ReleasedByService (0),
successful-DisconnectByCallingParty (1),
successful-DisconnectByCalledParty (2),
successful-OngoingTollFree (3),
non-Successful-CalledPartyRouteSelectFailure (4),
non-Successful-CalledPartyBusy (5),
non-Successful-CalledPartyNotReachable (6),
non-Successful-CalledPartyNoAnswer (7),
non-Successful-CallingPartyAbandon (8),
non-Successful-OtherReason (14),
callForwardingHasBeenInvoked-ChargingCancelled (15)
}
CampaignIdentifier ::= INTEGER
CategoryValue ::= INTEGER
CategorizationInformation ::= SEQUENCE {
categoryType1 CategoryValue OPTIONAL,
categoryType2 CategoryValue OPTIONAL,
categoryType3 CategoryValue OPTIONAL,
categoryType4 CategoryValue OPTIONAL,
...
}
-- PC:09785
CauseCode ::= Integer32
-- PC:09785 end
CdrReason ::= ENUMERATED {
serviceClassRequested (0),
firstInterrogationUnsuccessful (1),
invokeIntermediateInterrogationFinalReportUnsucc (2),
internalError (3),
subscriberTemporaryBlocked (4),
partialDeduction (5)
}
CCAccountData ::= SEQUENCE
{
servedAccount AddressString,
serviceClassID ServiceClassID,
accountGroupID AccountGroupID,
accountValueBefore MonetaryUnits OPTIONAL,
accountValueAfter MonetaryUnits OPTIONAL,
communityInformation CommunityInformation OPTIONAL,
accumulators Accumulators OPTIONAL,
dedicatedAccounts DedicatedAccounts OPTIONAL,
familyAndFriendsID FamilyAndFriendsID OPTIONAL,
familyAndFriendsNo AddressString OPTIONAL,
serviceOfferings Unsigned32,
accumulatedCost MonetaryUnits OPTIONAL,
accountValueUsed MonetaryUnits OPTIONAL,
accountValueDeducted MonetaryUnits,
-- PC
aggregatedValueBefore MonetaryUnits OPTIONAL,
aggregatedValueAfter MonetaryUnits OPTIONAL,
-- end PC
accumulatedUnits Integer64 OPTIONAL,
accountUnitsUsed Integer64 OPTIONAL,
accountUnitsDeducted Integer64 OPTIONAL,
specifiedConsumptions SpecifiedConsumptions OPTIONAL,
usedOffers UsedOffers OPTIONAL,
usageCounters SEQUENCE OF UsageCounter OPTIONAL,
providersFamilyAndFriendsID FamilyAndFriendsID OPTIONAL,
-- PC:10276
usedOffersAdditionalInfo UsedOffersAdditionalInfo OPTIONAL,
-- PC:10276 end
...
}
CellID ::= OCTET STRING
ChargingContext ::= UTF8String
ChargedDuration ::= OCTET STRING

ChargedProductFee ::= SEQUENCE
{
chargedFee MonetaryUnits,
accountValueBefore MonetaryUnits OPTIONAL,
accountValueAfter MonetaryUnits OPTIONAL,
dedicatedAccounts DedicatedAccounts OPTIONAL,
usageCounters SEQUENCE OF UsageCounter OPTIONAL,
...
}

ChargingID ::= OCTET STRING
-- PC:10064
ChargingRuleBaseName ::= UTF8String
ChargingRuleName ::= OCTET STRING
-- PC:10064 end
-- PC:08842
ChargingSuppressionAtForwarding ::= ENUMERATED {
notSuppressChargingAtForwarding (0),
suppressChargingAtForwarding (1)
}
-- PC:08842 end
CommunityDataInfo ::= SEQUENCE {
selectedCommunityIndicator SelectedCommunityIndicator OPTIONAL,
communityIDCharged SEQUENCE OF CommunityID OPTIONAL,
communityIDNonCharged SEQUENCE OF CommunityID OPTIONAL,
communityDataNonChargedNotAvailable BOOLEAN OPTIONAL,
...
}
CommunityID ::= INTEGER

CommunityIDs ::= SEQUENCE
{
communityID1 CommunityID OPTIONAL,
communityID2 CommunityID OPTIONAL,
communityID3 CommunityID OPTIONAL,
...
}

CommunityInformation ::= SEQUENCE
{
selectedCommunityID CommunityID OPTIONAL,
servedCommunityIDs CommunityIDs OPTIONAL,
nonServedCommunityIDs CommunityIDs OPTIONAL,
nonServedCommunityIDNA BOOLEAN OPTIONAL,
nonServedCommunityNo AddressString OPTIONAL,
...
}

ContextParameter ::= SEQUENCE
{
parameterID Integer64,
parameterValue ContextParameterValueType
}

ContextParameterValueType ::= CHOICE
{
boolean BOOLEAN,
integer32 Integer32,
integer64 Integer64,
unsigned32 Unsigned32,
unsigned64 Unsigned64,
addressString AddressString,
octetString OCTET STRING,
string UTF8String,
time Time,
partyInformation PartyInformation,
-- PC:09750
group Group,
partyInformations PartyInformations,
strings Strings,
groups Groups,
-- PC:09750 end
--PC:10699
monetaryUnits MonetaryUnits,
--PC:10699 end

...
}

CorrelationID ::= CHOICE {
callReference CallReferenceNumber,
chargingID ChargingID,
accountingCorrelationID AccountingCorrelationID,
dccCorrelationId DccCorrelationID,
...
}
-- PC:09785

CreditControlFailureHandling ::= ENUMERATED {
terminate (0),
continue (1)
}

CreditControlRecord ::= SEQUENCE
{
serviceIdentifier Unsigned32,
usedServiceUnits UsedServiceUnits OPTIONAL,
eventTime TimeStamp,
triggerTime TimeStamp,
serviceScenario ServiceScenario,
serviceExtension ServiceExtension OPTIONAL,
roamingPosition RoamingPosition OPTIONAL,
tariffInfo SEQUENCE OF
SelectionTreeParameter OPTIONAL,
cCAccountData CCAccountData,
chargingContextSpecific SEQUENCE OF
ContextParameter OPTIONAL,
treeDefinedFields SEQUENCE OF
TreeDefinedField OPTIONAL,
bonusAdjustment BonusAdjustment OPTIONAL,
serviceSetupResult ServiceSetupResult OPTIONAL,
terminationCause TerminationCause OPTIONAL,
ratedUnits RatedUnits OPTIONAL,
individualPriceFactorHistory SEQUENCE OF IndividualPriceFactorHistory OPTIONAL,
periodicAccountMgmtData PeriodicAccountMgmtData OPTIONAL,
providerCreditControlRecord SEQUENCE OF ProviderCreditControlRecord OPTIONAL,
-- PC:10739
chargingContextOutputFields SEQUENCE OF
ServiceOutputField OPTIONAL,
-- PC:10739 end
...
}
-- PC:09785 end
CurrencyType ::= ENUMERATED {
localCurrency (0),
eURO (1)
}
DAID ::= INTEGER
DataVolume ::= OCTET STRING
Date ::= IA5String
DccCorrelationID ::= SEQUENCE {
acctMultiSessionID AcctMultiSessionID OPTIONAL,
ccCorrelationId OCTET STRING OPTIONAL,
sessionId UTF8String OPTIONAL,
ccRequestNumber Unsigned32 OPTIONAL,
...
}

DedicatedAccountAccDuration ::= INTEGER
DedicatedAccountInfo ::= SEQUENCE {
identity DAID OPTIONAL,
valueBefore MoneyAmount OPTIONAL,
valueAfter MoneyAmount OPTIONAL,
campaignIdentifier CampaignIdentifier OPTIONAL,
accumulatedDuration DedicatedAccountAccDuration OPTIONAL,
...
}
DedicatedAccounts ::= SEQUENCE OF DedicatedAccount
DedicatedAccount ::= SEQUENCE
{
dedicatedAccountID DedicatedAccountID,
dedicatedAccountValueBefore MonetaryUnits OPTIONAL,
dedicatedAccountValueAfter MonetaryUnits OPTIONAL,
dedicatedAccountChange MonetaryUnits OPTIONAL,
dedicatedAccountCampaignID DedicatedAccountCampaignID OPTIONAL,
accountExpiryDateBefore Date OPTIONAL,
accountExpiryDateAfter Date OPTIONAL,
accountStartDateBefore Date OPTIONAL,
accountStartDateAfter Date OPTIONAL,
-- PC
realMoney BOOLEAN OPTIONAL,
-- end PC
offerID OfferID OPTIONAL,
dedicatedAccountUnitsBefore Unsigned64 OPTIONAL,
dedicatedAccountUnitsAfter Unsigned64 OPTIONAL,
dedicatedAccountUnitsChange Integer64 OPTIONAL,
accountUnitType AccountUnitType OPTIONAL,
subDedicatedAccounts SubDedicatedAccounts OPTIONAL,
-- PC:09847
productID ProductID OPTIONAL,
-- end PC:09847
-- PC:10276
offerExpiryDate Date OPTIONAL,
offerStartDate Date OPTIONAL,
-- PC:10276 end
...
}
DedicatedAccountID ::= INTEGER
DedicatedAccountCampaignID ::= INTEGER

DedicatedAccountSpecifiedConsumption ::= SEQUENCE
{
dedicatedAccountID DedicatedAccountID,
dedicatedAccountRatedUnits ServiceUnits OPTIONAL,
dedicatedAccountDeducted MonetaryUnits,
...
}

FloatingDecimal ::= SEQUENCE
{
digits Integer64,
decimals Integer32,
...
}

ExtInt ::= INTEGER
ExtText ::= OCTET STRING

FamilyAndFriendsID ::= INTEGER
FamilyAndFriendsIndicator ::= INTEGER

Group ::= SEQUENCE OF ContextParameter
Groups ::= SEQUENCE OF Group

GPRSQoS ::= INTEGER
GSNAddress ::= EXPLICIT IPBinaryAddress
IndividualPriceFactor ::= INTEGER

IndividualPriceFactorHistory ::= SEQUENCE {
individualPriceFactor1 IndividualPriceFactor OPTIONAL,
individualPriceFactor2 IndividualPriceFactor OPTIONAL,
individualPriceFactor1Units Units OPTIONAL,
...
}
-- PC:10210
IMEI ::= OCTET STRING
-- PC:10210 end
IMSChargingIdentifier ::= UTF8String
IMSI ::= OCTET STRING

Integer8 ::= INTEGER

Integer32 ::= INTEGER
Integer64 ::= INTEGER
IPBinaryAddress ::= CHOICE {
iPBinV4Address OCTET STRING,
iPBinV6Address OCTET STRING
}

LifeCycleInformation ::= SEQUENCE
{
supervisionExpDateBefore Date OPTIONAL,
supervisionExpDateAfter Date OPTIONAL,
creditClearancePeriodBefore Period OPTIONAL,
creditClearancePeriodAfter Period OPTIONAL,
servFeeExpDateBefore Date OPTIONAL,
servFeeExpDateAfter Date OPTIONAL,
serviceRemovalPeriodBefore Period OPTIONAL,
serviceRemovalPeriodAfter Period OPTIONAL,
accountFlagsBefore AccountFlags OPTIONAL,
accountFlagsAfter AccountFlags OPTIONAL,
...
}
LocationAreaID ::= OCTET STRING
LocalSequenceNumber ::= OCTET STRING

MainAccountSpecifiedConsumption ::= SEQUENCE
{
mainAccountRatedUnits ServiceUnits OPTIONAL,
mainAccountDeducted MonetaryUnits,
...
}

MonetaryUnits ::= SEQUENCE
{
amount Integer64,
decimals Integer32,
currency Unsigned32
}
MoneyAmount ::= OCTET STRING
MultiSessionID ::= OCTET STRING
NetworkID ::= INTEGER
NodeID ::= OCTET STRING
NumberOfEvents ::= INTEGER
NumberOfSDPInterrogations ::= INTEGER
OriginHost ::= OCTET STRING
OriginInfo ::= SEQUENCE {
originRealm OriginRealm OPTIONAL,
originHost OriginHost OPTIONAL,
...
}

OfferAttributes ::= SEQUENCE OF OfferAttribute
OfferAttribute ::= SEQUENCE
{
attributeName UTF8String,
attributeValueString UTF8String OPTIONAL,
...
}

OfferID ::= INTEGER

OfferType ::= ENUMERATED
{
account (0),
multiUserIdentification (1)
}

OriginRealm ::= OCTET STRING
-- PC:09785
OutgoingSessionId ::= UTF8String
-- PC:09785 end

PamPeriod ::= IA5String

PartyInformations ::= SEQUENCE OF PartyInformation

PartyInformation ::= CHOICE
{
msisdn AddressString,
imsi AddressString,
sipUri UTF8String,
nai UTF8String,
...
}

Percent ::= IA5String

Period ::= Unsigned8

PeriodicAccountMgmtData ::= SEQUENCE
{
pamServiceID Integer32,
pamClassID Integer32,
scheduleID Integer32,
currentPamPeriod PamPeriod,
...
}

PriceFactor ::= SEQUENCE
{
priceFactor Percent OPTIONAL,
units ServiceUnits OPTIONAL,
...
}

PriorityLevel ::= INTEGER

ProductID ::= INTEGER

ProviderCCAccountData ::= SEQUENCE
{
providerAccount AddressString,
providerServiceClassID ServiceClassID,
accountGroupID AccountGroupID,
dedicatedAccounts DedicatedAccounts OPTIONAL,
familyAndFriendsID FamilyAndFriendsID OPTIONAL,
familyAndFriendsNo AddressString OPTIONAL,
accumulatedCost MonetaryUnits OPTIONAL,
accountValueUsed MonetaryUnits OPTIONAL,
accountValueDeducted MonetaryUnits,
accumulatedUnits Integer64 OPTIONAL,
accountUnitsDeducted Integer64 OPTIONAL,
specifiedConsumptions SpecifiedConsumptions OPTIONAL,
usageCounters SEQUENCE OF UsageCounter OPTIONAL,
providersFamilyAndFriendsID FamilyAndFriendsID OPTIONAL,
...
}

ProviderCreditControlRecord ::= SEQUENCE
{
providerCCAccountData ProviderCCAccountData,
providerRatedUnits RatedUnits OPTIONAL,
providerPAMData PeriodicAccountMgmtData OPTIONAL,
...
}

ProviderCreditControlRecord ::= SEQUENCE
{
providerCCAccountData ProviderCCAccountData,
providerRatedUnits RatedUnits OPTIONAL,
providerPAMData PeriodicAccountMgmtData OPTIONAL,
...
}

QoSClassIdentifier ::= INTEGER
Qualifier ::= INTEGER

RatedUnits ::= SEQUENCE
{
debitUnits RatedUnitsValues OPTIONAL,
creditUnits RatedUnitsValues OPTIONAL,
freeUnits RatedUnitsValues OPTIONAL,
...
}

RatedUnitsValues ::= SEQUENCE
{
ratedTimeUnits Unsigned32 OPTIONAL,
ratedTotalOctetsUnits Unsigned64 OPTIONAL,
ratedUplinkOctetsUnits Unsigned64 OPTIONAL,
ratedDownlinkOctetsUnits Unsigned64 OPTIONAL,
ratedServiceSpecificUnits Unsigned64 OPTIONAL,
...
}

RadiusSessionID ::= OCTET STRING
RatedDurations ::= SEQUENCE {
debitDuration ChargedDuration OPTIONAL,
creditDuration ChargedDuration OPTIONAL,
freeDuration ChargedDuration OPTIONAL,
...
}
RecordIdentificationNumber ::= OCTET STRING
RecordSequenceNumber ::= OCTET STRING
RecoveryRecord ::= SEQUENCE {
ccnTimeStamp TimeStamp,
accumulatorModificationDate TimeStamp,
recoveryState RecoveryState,
globalDeltaVolumeUL DataVolume OPTIONAL,
globalDeltaVolumeDL DataVolume OPTIONAL,
serviceClassDeltaValueList SEQUENCE OF
RecoveryServiceClassInfo OPTIONAL,
...
}
RecoveryServiceClassInfo ::= SEQUENCE {
serviceClass ServiceClass,
deltaTime DataVolume OPTIONAL,
deltaVolumeUL DataVolume OPTIONAL,
deltaVolumeDL DataVolume OPTIONAL,
...
}
RecoveryState ::= ENUMERATED {
normal (1),
provisioningRecovery (2),
cdrRecovery (3)
}
RoamingPosition ::= ENUMERATED
{
insideHPLMN(0),
outsideHPLMN(1)
}
SelectionTreeParameter ::= SEQUENCE
{
selectionTreeID UTF8String,
selectionTreeVersion UTF8String,
selectionTreeType SelectionTreeType,
...
}
SelectionTreeType ::= ENUMERATED
{
rating(0),
bonus(1),
selection(2),
dedicatedAccount(3),
communityCharging(4),
numberNormalization(5),
ussdTextMessage(6),
accountManagement(7),
preAnalysis(8),
periodicAccountManagement(9)
}
SDPCreditControlRecord ::= CHOICE
{
creditControlRecord CreditControlRecord,
...
}
SelectedCommunityIndicator ::= INTEGER
ServiceClass ::= INTEGER
ServiceClassID ::= INTEGER
ServiceClassExtendedInfo ::= SEQUENCE {
serviceClass ServiceClass,
timeAccumulated DataVolume,
...
}

ServiceExtension ::= ENUMERATED
{
ussdCallback(0),
capV1Roaming(1)
}

ServiceOfferings ::= INTEGER
-- 0 undefined
-- 1 - 2147483647 serviceOfferings

ServiceOutputField ::= SEQUENCE
{
parameterID Unsigned32,
parameterValue ServiceOutputFieldType,
parameterName UTF8String OPTIONAL,
...
}

ServiceOutputFieldType ::= CHOICE
{
integer64 Integer64,
string UTF8String,
octetString OCTET STRING,
...
}

ServiceProviderID ::= INTEGER
ServiceClassInfo ::= SEQUENCE {
serviceClass ServiceClass,
volumeULAccumulated DataVolume,
volumeDLAccumulated DataVolume
}
ServiceScenario ::= ENUMERATED
{
mobileOriginating(0),
mobileForwarding(1),
mobileTerminating(2)
}
ServingElement ::= CHOICE {
originInfo OriginInfo,
mSCAddress AddressString,
ggsnAddress GSNAddress,
sgsnAddress GSNAddress,
...
}
SessionID ::= OCTET STRING
SmsDeliveryStatus ::= ENUMERATED {
delivered (1),
expired (2)
}

SpecifiedConsumptions ::= SEQUENCE OF SpecifiedConsumption
SpecifiedConsumptionAccounts ::= SEQUENCE OF SpecifiedConsumptionPerAccount

SpecifiedConsumption ::= SEQUENCE
{
selectionTreeQualifiers SelectionTreeQualifiers,
specifiedConsumptionAccounts SpecifiedConsumptionAccounts,
offerID OfferID OPTIONAL,
individualPriceFactorAtUnit
IndividualPriceFactorHistory OPTIONAL,
terminationAtUnit ServiceUnits OPTIONAL,
eligibleOfferAtUnit ServiceUnits OPTIONAL,
offerProviderID AddressString OPTIONAL,
productID ProductID OPTIONAL,
offerAttributes OfferAttributes OPTIONAL, -- No
--Not use, under development
chargedProductFee ChargedProductFee OPTIONAL,
--Not use, under development end
priceFactorAtUnit PriceFactor OPTIONAL,
...
}

SpecifiedConsumptionNoCost ::= SEQUENCE
{
providedUnits ServiceUnits,
...
}

SpecifiedConsumptionPerAccount ::= SEQUENCE
{
units ServiceUnits,
accountSpecifiedConsumption AccountSpecifiedConsumption,
accumulatorSpecifiedConsumptions AccumulatorSpecifiedConsumptions OPTIONAL,
usageCounterSpecifiedConsumptions UsageCounterSpecifiedConsumptions OPTIONAL,
...
}
SelectionTreeQualifiers ::= SEQUENCE OF Qualifier

StartOfUsageInfo ::= SEQUENCE {
serviceClass ServiceClass,
startOfUsage TimeStamp
}

Strings ::= SEQUENCE OF UTF8String

ServiceUnits ::= SEQUENCE
{
timeUnit Unsigned32 OPTIONAL,
moneyUnit MonetaryUnits OPTIONAL,
totalOctetsUnit Unsigned64 OPTIONAL,
uplinkOctetsUnit Unsigned64 OPTIONAL,
downlinkOctetsUnit Unsigned64 OPTIONAL,
serviceSpecificUnit Unsigned64 OPTIONAL,
...
}

ServiceSetupResult ::= ENUMERATED
{
successfulReleasedByService(0),
successfulDisconnectedByCallingParty(1),
successfulDisconnectByCalledParty(2),
successfulTollfree(3),
nonSuccessfulCalledPartyRouteSelectFailure(4),
nonSuccessfulCalledPartyBusy(5),
nonSuccessfulCalledPartyNotReachable(6),
nonSuccessfulCalledPartyNoAnswer(7),
nonSuccessfulCallingPartyAbandon(8),
nonSuccessfulOtherReason(14),
callForwardingChargingCancelled(15)
}

SubDedicatedAccounts ::= SEQUENCE OF SubDedicatedAccount

SubDedicatedAccount ::= SEQUENCE
{
dedicatedAccountID DedicatedAccountID,
dedicatedAccountValueBefore MonetaryUnits OPTIONAL,
dedicatedAccountValueAfter MonetaryUnits OPTIONAL,
dedicatedAccountChange MonetaryUnits OPTIONAL,
accountExpiryDateAfter Date OPTIONAL,
accountStartDateAfter Date OPTIONAL,
dedicatedAccountUnitsBefore Unsigned64 OPTIONAL,
dedicatedAccountUnitsAfter Unsigned64 OPTIONAL,
dedicatedAccountUnitsChange Integer64 OPTIONAL,
...
}

SubscriberGroup ::= OCTET STRING
SubscriptionID ::= SEQUENCE {
subscriptionIDType SubscriptionIDType,
subscriptionIDValue SubscriptionIDData
}
SubscriptionIDData ::= UTF8String
SubscriptionIDType ::= ENUMERATED {
endUserE164 (0),
endUserIMSI (1),
endUserSIPURI (2),
endUserNAI (3),
endUserPrivate (4)
}
SubscriptionType ::= INTEGER

TariffChangeUsage ::= ENUMERATED
{
before (0),
after (1),
indeterminate (2)
}
TeleServiceCode ::= ENUMERATED {
voice (0),
fax (1),
data (2),
unknown (3),
sMS (4),
gPRS (5),
content (6),
videoTelephony (7),
videoConference (8),
extensionTSC1 (65526),
extensionTSC2 (65527),
extensionTSC3 (65528),
extensionTSC4 (65529),
extensionTSC5 (65530),
extensionTSC6 (65531),
extensionTSC7 (65532),
extensionTSC8 (65533),
extensionTSC9 (65534),
extensionTSC10 (65535)
}

TerminationCause ::= ENUMERATED
{
diameterLogout(1),
diameterServiceNotProvided(2),
diameterBadAnswer(3),
diameterAdministrative(4),
diameterLinkBroken(5),
diameterAuthExpired(6),
diameterUserMoved(7),
diameterSessionTimeout(8)
}

Time ::= SEQUENCE
{
sec Integer32,
tz Integer8
}

TimeStamp ::= OCTET STRING
TrafficCase ::= ENUMERATED {
originatingInsideHPLMN (0),
forwardedInsideHPLMN (1),
terminatingInsideHPLMN (2),
originatingOutsideHPLMNCAPv1 (3),
forwardedOutsideHPLMNCAPv1 (4),
terminatingOutsideHPLMN (5),
roamingCallBackOutsideHPLMN (6),
originatingOutsideHPLMNCAPv2 (7),
forwardedOutsideHPLMNCAPv2 (8),
terminatingOutsideHPLMNCAPv2 (9),
originatingOutsideHPLMNCAPv3 (10),
forwardedOutsideHPLMNCAPv3 (11),
terminatingOutsideHPLMNCAPv3 (12),
originatingServiceCharging (20),
terminatingServiceCharging (21)
}
-- PC:10210
TreeDefinedField ::= SEQUENCE
{
parameterID UTF8String,
parameterValue TreeDefinedFieldType
}

TreeDefinedFieldType ::= CHOICE
{
boolean BOOLEAN,
integer64 Integer64,
date Date,
string UTF8String,
floatingDecimalTDF FloatingDecimal,
amountTDF MonetaryUnits,
...
}

TrunkGrpNo ::= INTEGER
TrunkInformation ::= SEQUENCE {
inTrunkGrpNo TrunkGrpNo OPTIONAL,
outTrunkGrpNo TrunkGrpNo OPTIONAL,
...
}
-- PC:10210 end
Units::= SEQUENCE {
duration ChargedDuration OPTIONAL,
numberOfEvents NumberOfEvents OPTIONAL,
...
}

Unsigned8 ::= INTEGER
Unsigned32 ::= INTEGER
Unsigned64 ::= INTEGER

UsageCounter ::= SEQUENCE
{
usageCounterID UsageCounterID,
usageCounterValueBefore UsageCounterType OPTIONAL,
usageCounterValueAfter UsageCounterType OPTIONAL,
usageCounterChange UsageCounterType OPTIONAL,
productID ProductID OPTIONAL,
...
}

UsageCounterID ::= INTEGER

UsageCounterSpecifiedConsumptions ::= SEQUENCE OF UsageCounterSpecifiedConsumption
UsageCounterSpecifiedConsumption ::= SEQUENCE
{
usageCounterID UsageCounterID,
usageCounterChange UsageCounterType OPTIONAL,
productID ProductID OPTIONAL,
...
}

UsageCounterType ::= CHOICE
{
usageCounterUnit Unsigned64,
usageCounterMoney MonetaryUnits,
...
}

UsedOffers ::= SEQUENCE OF OfferID

UsedOffersAdditionalInfo ::= SEQUENCE OF UsedOfferAdditionalInfo
--PC:10276 end

-- PC:10276
UsedOfferAdditionalInfo ::= SEQUENCE
{
offerID OfferID,
offerExpiryDate Date OPTIONAL,
offerStartDate Date OPTIONAL,
offerType OfferType OPTIONAL,
offerDisabled BOOLEAN OPTIONAL,
offerExpiryDateTime TimeStamp OPTIONAL,
offerStartDateTime TimeStamp OPTIONAL,
...
}

UsedServiceUnit ::= SEQUENCE {
tariffChangeUsage TariffChangeUsage OPTIONAL,
timeUnit Unsigned32 OPTIONAL,
moneyUnit MonetaryUnits OPTIONAL,
totalOctetsUnit Unsigned64 OPTIONAL,
uplinkOctetsUnit Unsigned64 OPTIONAL,
downlinkOctetsUnit Unsigned64 OPTIONAL,
serviceSpecificUnit Unsigned64 OPTIONAL,
...
}
UsedServiceUnits ::= SEQUENCE OF UsedServiceUnit
UsedUnchargedDuration ::= OCTET STRING
UsedUnchargedEvent ::= OCTET STRING
UserName ::= OCTET STRING

--PC:09785
UserSessionID ::= UTF8String
--PC:09785 end

decode problem with ASN INTEGER when value is colon seperated hex

When encountering a serialNumber (type of CertificateSerialNumber) with type of INTEGER and a value that has a hex encoding format, for example, like 00:00:00:00:00:00:00:00:00:00:00:00, (yes, I know, some CAs seem to have delusions of grandeur with their serial numbering policies) the returned data structure is similar to:

'serialNumber' => bless( {
'value' => [
237291436,
579135199,
318680686,
480253832,
1492158
],
'sign' => '+'
}, 'Math::BigInt' )

I tried changing the CertificateSerialNumber type to OCTET STRING, but I only got asn decode error. How to proceed with this situation?

Regression in 0.25: Can't use string ("cn") as an ARRAY ref while "strict refs" in use at Convert/ASN1/_encode.pm line 269

The following short script:

use strict;
use warnings;
use Net::LDAP;
my $ldap_con = Net::LDAP->new(
        'ldap.office.noris.de:389',
        onerror => 'die',
        version => 3
        );

$ldap_con->search(
        base    => 'ou=People,dc=noris,dc=de',
        filter  => '(&(objectClass=norisPerson) (!(NSAccountLock=*)))',
        scope   =>  "sub",
        attrs   =>  'cn'
        );

works fine with Convert::ASN1 up to version 0.24, but dies with

$ perl ldap.pl
Can't use string ("cn") as an ARRAY ref while "strict refs" in use at /home/mlenz/perl5/lib/perl5/Convert/ASN1/_encode.pm line 269, <DATA> line 581.
 at ldap.pl line 10.

with versions 0.25 and newer.

I'm having a hard time trying to find out how exactly Net::LDAP calls Convert::ASN1, but all attempts to squeeze backtraces out of Net::LDAP have failed me so far.

Please let me know if and how I can provide more context for you to debug this.

Find macro by tag

Add a method to find a macro by its tag.

This could be used within decode if called on an object that has no selected macro

โ€œbigintโ€ requirements

What are the intended requirements of a substitute class for Math::BigInt?

The docs donโ€™t make it clear whether it should implement the overloaded operators or binc(), bneg(), etc.

Strings garbled in $asn->encode(...) when 'use encoding' is in effect.

When your application contains "use encoding 'some_charset'" then when you $asn->encode(...) something the resulting buffer is garbled because of implicit latin->Unicode conversion when concatenating binary strings and character strings.

This happens because multiple "chr(...)" invocations in Convert::ASN1::_encode generate Unicode strings because 'use encoding' is not scoped.

Possible solution: use "pack( 'C', ... )" instead of "chr(...)" in _encode.pm. I don't have the needed knowledge of ASN1 to point out how they exactly can be replaced (for example, i'm not sure about _enc_bitstring and _enc_utf8 encoders).

Workaround1: never "use encoding" in production without threats of violence towards you.

Workaround2: add "use bytes;" in the beginning of Convert::ASN1::_encode (this is a workaround because it is not compatible with older perls). "use bytes" is scoped contrary to "use encoding" so this shouldn't break things in other places of your code. But I didn't check working with certificates with non-ASCII/non-binary data inside.

From perldoc perlunicode:

The "chr()" and "ord()" functions work on characters, similar to "pack("W")" and "unpack("W")", not "pack("C")" and "unpack("C")". "pack("C")" and "unpack("C")" are methods for emulating byte-oriented "chr()" and "ord()" on Unicode strings. While these methods reveal the internal encoding of Unicode strings, that is not something one normally needs to care about at all.

Is there a way to install Convert::ASN1 offline

I run Cygwin and while installing OpenLDAP client called led I ran into an error
Net::LDAP ....................** FAILED **
Can't locate Convert/ASN1.pm in @inc
The Net::LDAP module is required for led
I don't want to start network things on Cygwin, and I haven't found any offline installation notes.

Unsafe decoding creates infinite loop

The following test of decoding unsafe input will make an infinite loop spewing warnings in 0.26:

use Convert::ASN1;
my $asn = Convert::ASN1->new;
$asn->prepare(q<
  [APPLICATION 7] SEQUENCE {
    int INTEGER
  }
>);
my $out;
$out = $asn->decode( pack("H*", "dfccd3fde3") );
$out = $asn->decode( pack("H*", "b0805f92cb") );

I ran random 5-byte strings to find two repeatable examples.

Fix: Add a position check to the two do loops on lines 636 and 690 of _decode.pm:

    do {
      $tag .= substr($_[0],$pos++,1);
      $b = ord substr($tag,-1);
    } while($b & 0x80 && $pos < $end);

This can happen in Convert::PEM when an incorrect password is used. See RT 27574 for an example.

"Redundant argument in printf" warning on Debug.pm line 98 with perl 5.32

I also see this in perl5.28 and perl5.30, but I've not been following perl5 development closely enough to know when this changed or broke.

With -w and use warnings in effect and Convert::ASN1 version 0.31, calling:

Convert::ASN1::asn_dump(*STDOUT, $str);

where $str is a bunch of raw BER, results in an annoying warning every time line 98 is hit:

Redundant argument in printf at /opt/local/lib/perl5/vendor_perl/5.32/Convert/ASN1/Debug.pm line 98, <> line 1. 0000 1294: SEQUENCE {

I see the same (unsurprisingly) using Net::LDAP's debug(15) mode.

Selective decoding

I ran into another potential useful feature.

A protocol defined in ASN1 might include data blocks opaque to the client, which happen to also be defined by the ASN1 spec.

I such case decode would return the decoded hash for that field where what you actually need is the raw encoded data.

An example is the ticket in a Kerberos AS-REP message.

You could of course just encode it back when you get it, but I guess it has an APPLICATION tag exactly for the reason to be able to recognize it as a ticket later and then decode it if necessary.

So a nice feature would be to specify a list of APPLICATION tags to decode, which it didn't recurse into or alternatively made available in "raw" format too.

... or maybe this could just be done my registering a handler.

Unable to decode CDRs written in a fixed blocks size with padding bytes

Depending on the network switch, CDRs can be written in a fixed blocks size that are completed with padding bytes at the end of each block to reach the defined block size if necessary.

Is there a way to accepts the block size information and skips padding bytes accordingly?
If the block size is not known the CDR Converter can detect it automatically?

Problems with default EXPLICIT tagging

Hi,

I can't get Convert::ASN1 to generate the correct DER explicit tagging.

Looking at the example in the DER spec section 8.14.3 it says:

With ASN.1 type definitions (in an explicit tagging environment) of:
Type1 ::= VisibleString
Type2 ::= [APPLICATION 3] IMPLICIT Type1
Type3 ::= [2] Type2
...
a value of:
"Jones"
is encoded as follows:

For Type1:
VisibleString
1A
Length Contents
05 4A6F6E6573

For Type2:
[Application 3]
43
Length Contents
05 4A6F6E6573

For Type3:
[2]
A2
Length
07
Contents
[APPLICATION 3]
43
Length Contents
05 4A6F6E6573

...

However. Convert ASN1 encodes the 3 examples as:
Type1: 1a 05 4a 6f 6e 65 73
Type2: 43 05 4a 6f 6e 65 73
Type3: 82 05 4a 6f 6e 65 73

Type3 should have been: a2 07 43 05 4a 6f 6e 65 73
... which Convert::ASN1 will do correctly if the definition of Type3 is changed to:
Type3 ::= [2] EXPLICIT Type2

But isn't "EXPLICIT" tagging default?

The problem seems to be due to this statement in parser.y:

plicit : { $$ = undef; }
| EXPLICIT { $$ = 1; }
| IMPLICIT { $$ = 0; }
;

Where the default tagging gets the undef value, so when there tested for truthness in rules like below it ends up being implicit tagging:

aitem : class plicit anyelem postrb
{
$3->[cTAG] = $1;
$$ = $2 ? explicit($3) : $3;
}
| celem
;

BMPString data not fully decoded

At least in Microsoft CSRs, fields that are encoded as BMPString are returned by Convert:ASN1 as a string of octets (utf-8?) , apparently UCS2-BE. If "ABC" is encoded in the CSR, it comes out of Convert::ASN1 as "\0A\0B\0C".

Although it's possible to use Encode::decode('UCS2-BE', $value) to get a Perl-compatible string, Convert::ASN1 should be doing this before the string is returned.

Given the history, it may be necessary to enable the proper behavior with an option, since double decoding would corrupt the data.

Thanks.

Convert::ASN1 can't be fatpacked

Fatpacking an app that depends on this module causes these errors:

Bareword "cVAR" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 56, <DATA> line 755.
Bareword "cTAG" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 58, <DATA> line 755.
Bareword "cEXT" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 63, <DATA> line 755.
Bareword "cTAG" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 67, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 69, <DATA> line 755.
Bareword "cTAG" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 86, <DATA> line 755.
Bareword "ASN_CONSTRUCTOR" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 86, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 86, <DATA> line 755.
Bareword "cEXT" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 109, <DATA> line 755.
Bareword "cTAG" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 113, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 113, <DATA> line 755.
Bareword "cVAR" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 113, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 118, <DATA> line 755.
Bareword "opANY" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 118, <DATA> line 755.
Bareword "cEXT" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 124, <DATA> line 755.
Bareword "cDEFINE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 131, <DATA> line 755.
Bareword "cDEFINE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 132, <DATA> line 755.
Bareword "cVAR" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 133, <DATA> line 755.
Bareword "cDEFINE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 133, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 141, <DATA> line 755.
Bareword "opCHOICE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 141, <DATA> line 755.
Bareword "cEXT" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 149, <DATA> line 755.
Bareword "cCHILD" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 153, <DATA> line 755.
Bareword "cTAG" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 155, <DATA> line 755.
Bareword "cVAR" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 164, <DATA> line 755.
Bareword "cVAR" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 164, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 164, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 178, <DATA> line 755.
Bareword "opEXTENSIONS" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 178, <DATA> line 755.
Bareword "cTAG" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 183, <DATA> line 755.
Bareword "cTAG" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 213, <DATA> line 755.
Bareword "ASN_CONSTRUCTOR" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 213, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 213, <DATA> line 755.
Bareword "cVAR" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 234, <DATA> line 755.
Bareword "cEXT" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 249, <DATA> line 755.
Bareword "cTYPE" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 249, <DATA> line 755.
Bareword "opEXTENSIONS" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 249, <DATA> line 755.
Bareword "CHECK_UTF8" not allowed while "strict subs" in use at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 610, <DATA> line 755.
BEGIN not safe after errors--compilation aborted at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/Convert/ASN1/_decode.pm line 610, <DATA> line 755.
Compilation failed in require at /home/marcusr/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/App/FatPacker.pm line 149, <DATA> line 755.
BEGIN failed--compilation aborted at /home/marcusr/.plenv/versions/5.20.1/bin/fatpack line 3, <DATA> line 755.

Constructed ("indef") primitive values with tag not working

Hi,

given the following ASN.1 definition:

v ::= SEQUENCE { d [0] IMPLICIT OCTET STRING }

it seems the following input should be allowed:

$ printf '\x30\x80\xa0\x80\x04\x06Hello \x04\x06World!\x00\x00\x00\x00' | openssl asn1parse -inform DER -i
    0:d=0  hl=2 l=inf  cons: SEQUENCE          
    2:d=1  hl=2 l=inf  cons:  cont [ 0 ]        
    4:d=2  hl=2 l=   6 prim:   OCTET STRING      :Hello 
   12:d=2  hl=2 l=   6 prim:   OCTET STRING      :World!
   20:d=2  hl=2 l=   0 prim:   EOC               
   22:d=1  hl=2 l=   0 prim:  EOC               

(At least I see this happening in EncryptedContent in CMS messages; openssl uses ASN1_OCTET_STRING_NDEF for this special case).

Convert::ASN1 passes the $op for the outer (possibly constructed) data to the recursion for the inner handling, but doesn't replace the [0] tag with the primitive type (4), see _decode.pm:L86.

But the inner OCTET STRINGs aren't tagged with [0], they use their primitive type.

One could try to duplicate the $op and replace the tag with the type, and pass that to the recursion:

my $inner_op = [@$op];
bless $inner_op, ref $op;
$inner_op->[cTAG] = asn_encode_tag($op->[cTYPE]);

_decode(
# ...
[$inner_op],
# ...
);

If I knew I'd always get "chunked" values, I could simply write

v ::= SEQUENCE { d [0] IMPLICIT SET OF OCTET STRING }

instead... - but this is probably not the case, and I couldn't get a CHOICE working yet either.

Test case looks like this:

#!/usr/bin/env perl

use strict;

use Convert::ASN1;
use Data::Dumper;

my $p = Convert::ASN1->new;
$p->prepare("v ::= SEQUENCE { d [0] IMPLICIT OCTET STRING }");
my $d = $p->decode("\x30\x80\xa0\x80\x04\x06Hello \x04\x06World!\x00\x00\x00\x00") or die $!;
print Dumper($d);

Doc clarification needed

The "Exceptions" paragraph describing the ASN.1 syntax that's accepted by Convert::ASN1 reads:

There are some exceptions where Convert::ASN1 does not require an element to be named. These are SEQUENCE {...}, SET {...} and CHOICE. In each case if the element is not given a name then the elements inside the {...} will share the same namespace as the elements outside of the {...}.

I couldn't figure out what this means, nor could I find an example or a test in the distribution that matches this description.

And I couldn't create one, though I got a lot of syntax errors trying.

An example of omitting names and the resulting Perl would be appreciated.

As would a testcase. (And if perchance this is broken...perhaps a different change :-)

Thanks!

intermittent error: "oid is undefined when calling $asn1->encode"

With perl v5.22.1, using this test case: testcase.zip I have this error from time to time :

Failure: oid is undefined at test.pl line 21.

Line 21 is:

my $data = $asn1->encode(sig => $body,
    alg => {oid => sha512WithRSAEncryption()});

This is intermittent, so I use

for i in {1..10}; do                              
perl test.pl;      
done;

to easily reproduce.

Sergei Zhirikov, the maintainer of Uhura told me:

Further investigation led me to the conclusion that something inside Convert::ASN1 breaks with Perl hash randomization introduced in Perl 5.18 [...]. Fortunately, Perl allows to disable that randomization to mimic pre-5.18 behavior. By setting these environment variables: PERL_HASH_SEED=0x0 PERL_PERTURB_KEYS=0, I was able to run both the test script and the full uhura command without failures

I don't really know perl or its ecosystem, so I hope you'll have the info you need. Don't hesitate to ping me if you need more. Thanks!

TAR file format problem on Windows

There is an issue with the tar format of this module when it comes to Windows. I am not sure what is going on but have downloaded this module on Linux (Fedora 19) and untar'd and it creates the dir structure correctly. On Windows - I am using a ported tar.exe from the cmd line - and all of the files and dirs in the tar are flattened. Reorganizing them into the correct directories manually allows one to build the module just fine.

So I wanted to see if the issue was with the tar.exe I was using - so I tried using the automatic 'cpan' build tool from the cmd.exe line in Windows - and the contents of the tar file were again "flattened" - so that all files/dir were put into the current directory. I am pretty sure that 'cpan' is not using my tar.exe - but perhaps its own or something like Archive::Tar?

Debug output using print instead of printf?

There are some handy certs etc from RFC 3280 and RFC 5280 over at https://csrc.nist.gov/Projects/pki-testing/Sample-Certificates-and-CRLs

I'm using perl 5.34 and Convert::ASN1 0.330.

When I pass the example CRL into asn_dump() I see a few "%d" markers in the output. It looks like the asn_dump output format is changing a bit but there's maybe a print still being used instead of a printf. So it currently looks a bit busted:

005E   13:     [UNIVERSAL %d]: 23
0060     :       30 35 30 32 30 35 31 32 30 30 30 30 5A __ __ __ 050205120000Z
006D   13:     [UNIVERSAL %d]: 23
006F     :       30 35 30 32 30 36 31 32 30 30 30 30 5A __ __ __ 050206120000Z
007C   34:     SEQUENCE: 16 {
007E   32:       SEQUENCE: 16 {
0080    1:         INTEGER: 2 = 18
0083   13:         [UNIVERSAL %d]: 23
0085     :           30 34 31 31 31 39 31 35 35 37 30 33 5A __ __ __ 041119155703Z
0092   12:         SEQUENCE: 16 {
0094   10:           SEQUENCE: 16 {
0096    3:             OBJECT ID: 6 = 2.5.29.21
009B    3:             STRING: 4
009D     :               0A 01 01 __ __ __ __ __ __ __ __ __ __ __ __ __ ...
00A0     :           }
00A0     :         }
00A0     :       }
00A0     :     }
00A0   47:     [CONTEXT %d]: 0 {

dump() not handling RSA keys correctly?

openssl genrsa 2>/dev/null | perl -MConvert::ASN1 -MMIME::Base64 -MYAML::Syck -e'use bytes; my $k = do{ local $/; <>}; $k =~ s<^-.+?$><>msg; $k = MIME::Base64::decode($k); print Convert::ASN1::asn_dump($k)'
0000 1187: SEQUENCE {
0004    1:   INTEGER = 0
0007  257:   INTEGER = -1
010C    3:   INTEGER = 65537
0111  256:   INTEGER = -1
0215  129:   INTEGER = -1
0299  129:   INTEGER = -1
031D  128:   INTEGER = -1
03A0  128:   INTEGER = -1
0423  129:   INTEGER = -1
04A7     : }

Those -1 values are actually โ€œbig integersโ€.

SEQUENCE OF SEQUENCE not decoded

hex: 30 27 A0 1B 6B 19 30 17 80 04 30 30 38 41 A1 0F
30 0D 80 0B 38 39 35 31 39 39 39 39 39 39 39 A3
08 30 06 81 04 01 31 00 11 30 15 A0 13 6B 11 30
0F 80 04 30 30 38 41 A1 07 30 05 80 03 31 32 36
from ECMA-285:
ConnectionList ::= SEQUENCE OF SEQUENCE
{ newConnection [0] ConnectionID OPTIONAL,
oldConnection [1] ConnectionID OPTIONAL,
endpoint [2] CHOICE
{ deviceID DeviceID,
notKnown NULL} OPTIONAL,
associatedNID [3] CHOICE
{ deviceID DeviceID,
notKnown NULL} OPTIONAL,
resultingConnectionInfo ConnectionInformation OPTIONAL}

Fails tests without '.' in @INC

5.25.* with -Ddefault_inc_excludes_dot ( default since 5.25.11 )

Building and testing Convert-ASN1-0.27
cp lib/Convert/ASN1.pm blib/lib/Convert/ASN1.pm
cp lib/Convert/ASN1/parser.pm blib/lib/Convert/ASN1/parser.pm
cp lib/Convert/ASN1/Debug.pm blib/lib/Convert/ASN1/Debug.pm
cp lib/Convert/ASN1/_encode.pm blib/lib/Convert/ASN1/_encode.pm
cp lib/Convert/ASN1/_decode.pm blib/lib/Convert/ASN1/_decode.pm
cp lib/Convert/ASN1/IO.pm blib/lib/Convert/ASN1/IO.pm
cp lib/Convert/ASN1.pod blib/lib/Convert/ASN1.pod
PERL_DL_NONLAZY=1 "/home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/bin/perl5.25.10" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/00prim.t line 11.
BEGIN failed--compilation aborted at t/00prim.t line 11.
t/00prim.t ........ 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/01tag.t line 8.
BEGIN failed--compilation aborted at t/01tag.t line 8.
t/01tag.t ......... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/02seq.t line 8.
BEGIN failed--compilation aborted at t/02seq.t line 8.
t/02seq.t ......... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/11explicit.t line 3.
BEGIN failed--compilation aborted at t/11explicit.t line 3.
t/11explicit.t .... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/11indef.t line 7.
BEGIN failed--compilation aborted at t/11indef.t line 7.
t/11indef.t ....... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/03seqof.t line 7.
BEGIN failed--compilation aborted at t/03seqof.t line 7.
t/03seqof.t ....... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/04opt.t line 8.
BEGIN failed--compilation aborted at t/04opt.t line 8.
t/04opt.t ......... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/14any.t line 7.
BEGIN failed--compilation aborted at t/14any.t line 7.
t/14any.t ......... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/10choice.t line 8.
BEGIN failed--compilation aborted at t/10choice.t line 8.
t/10choice.t ...... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/12der.t line 8.
BEGIN failed--compilation aborted at t/12der.t line 8.
t/12der.t ......... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/13utf8.t line 8.
BEGIN failed--compilation aborted at t/13utf8.t line 8.
t/13utf8.t ........ 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/15extseq.t line 8.
BEGIN failed--compilation aborted at t/15extseq.t line 8.
t/15extseq.t ...... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/16extset.t line 8.
BEGIN failed--compilation aborted at t/16extset.t line 8.
t/16extset.t ...... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/05time.t line 13.
BEGIN failed--compilation aborted at t/05time.t line 13.
t/05time.t ........ 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/06bigint.t line 8.
BEGIN failed--compilation aborted at t/06bigint.t line 8.
t/06bigint.t ...... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/08set.t line 8.
BEGIN failed--compilation aborted at t/08set.t line 8.
t/08set.t ......... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/09contr.t line 8.
BEGIN failed--compilation aborted at t/09contr.t line 8.
t/09contr.t ....... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/07io.t .......... ok
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/x509.t line 5.
BEGIN failed--compilation aborted at t/x509.t line 5.
t/x509.t .......... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/17extchoice.t line 8.
BEGIN failed--compilation aborted at t/17extchoice.t line 8.
t/17extchoice.t ... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/18tagdefault.t line 8.
BEGIN failed--compilation aborted at t/18tagdefault.t line 8.
t/18tagdefault.t .. 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
Can't locate t/funcs.pl in @INC (@INC contains: /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/lib /home/kent/.cpanm/work/1490275354.18646/Convert-ASN1-0.27/blib/arch /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/site_perl/5.25.10 /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10/x86_64-linux /home/kent/perl5/perlbrew/perls/5.25.10-nossp-sdbm-nopmc-nodot/lib/5.25.10) at t/99misc.t line 8.
BEGIN failed--compilation aborted at t/99misc.t line 8.
t/99misc.t ........ 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 

Test Summary Report
-------------------
t/00prim.t      (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/01tag.t       (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/02seq.t       (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/11explicit.t  (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/11indef.t     (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/03seqof.t     (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/04opt.t       (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/14any.t       (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/10choice.t    (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/12der.t       (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/13utf8.t      (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/15extseq.t    (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/16extset.t    (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/05time.t      (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/06bigint.t    (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/08set.t       (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/09contr.t     (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/x509.t        (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/17extchoice.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/18tagdefault.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/99misc.t      (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=22, Tests=11,  1 wallclock secs ( 0.08 usr  0.05 sys +  0.82 cusr  0.20 csys =  1.15 CPU)
Result: FAIL
Failed 21/22 test programs. 0/11 subtests failed.
make: *** [Makefile:847: test_dynamic] Error 2

Convert::ASN1 just doesn't seem to handle MIBs at all

use Convert::ASN1;
use Data::Dump;

my $asn = Convert::ASN1->new;
$asn->prepare_file('snmpv2.mib');
dd $asn->error;
$asn->prepare_file('snmpv2-tc.mib');
dd $asn->error;
$asn->prepare_file('snmpv2-smi.mib');
dd $asn->error;
$asn->prepare('
org            OBJECT IDENTIFIER ::= { iso 3 }  --  "iso" = 1
dod            OBJECT IDENTIFIER ::= { org 6 }
internet       OBJECT IDENTIFIER ::= { dod 1 }
');
dd $asn->error;
$asn->prepare('
ExtUTCTime ::= OCTET STRING(SIZE(11 | 13))
');
dd $asn->error;

# Outputs...
"syntax error ::= BEGIN\n\nIMPORTS\n    MODULE-IDENTITY, \n"
"syntax error ::= BEGIN\n\nIMPORTS\n    TimeTicks        \n"
"syntax error ::= BEGIN\n\n-- the path to the root\n\norg \n"
"syntax error ::= { iso 3 }  --  \"iso\" = 1\ndod        \n"
"Parse error before (SIZE(11 | 13))\n\n"

I can't seem to make any progress in getting C:A to parse a full or partial MIB, even with the basic, low-level SNMPv2 standards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.