Skip to content

Commit

Permalink
fixes #497 - updating ASNItem() to recognize ASN1_APP_COUNTER64
Browse files Browse the repository at this point in the history
  • Loading branch information
rlebeau committed Sep 5, 2023
1 parent b5618f1 commit 93a3f55
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Lib/Protocols/IdASN1Util.pas
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ interface
ASN1_GAUGE = $42;
ASN1_TIMETICKS = $43;
ASN1_OPAQUE = $44;
ASN1_APP_COUNTER64 = $46;
// TODO: float, double, int64, uint64

function ASNEncOIDItem(Value: UInt32): string;
function ASNDecOIDItem(var Start: Integer; const Buffer: string): UInt32;
Expand Down Expand Up @@ -333,7 +335,9 @@ function ASNItem(var Start: Integer; const Buffer: string;
end;
Result := IntToStr(y);
end;
ASN1_COUNTER, ASN1_GAUGE, ASN1_TIMETICKS: //Typically a 32-bit _unsigned_ number
ASN1_COUNTER, ASN1_GAUGE, ASN1_TIMETICKS, //Typically a 32-bit _unsigned_ number
ASN1_APP_COUNTER64:
// TODO: int64, uint64
begin
z := 0;
for n := 1 to ASNSize do begin
Expand All @@ -344,6 +348,7 @@ function ASNItem(var Start: Integer; const Buffer: string;
end;
Result := IntToStr(z);
end;
// TODO: float, double
ASN1_OCTSTR, ASN1_OPAQUE:
begin
{$IFDEF STRING_IS_IMMUTABLE}
Expand Down

0 comments on commit 93a3f55

Please sign in to comment.