@@ -530,17 +530,17 @@ func parseSequenceOf(bytes []byte, sliceType reflect.Type, elemType reflect.Type
530
530
return
531
531
}
532
532
switch t .tag {
533
- case tagIA5String , tagGeneralString , tagT61String , tagUTF8String :
533
+ case TagIA5String , TagGeneralString , TagT61String , TagUTF8String :
534
534
// We pretend that various other string types are
535
535
// PRINTABLE STRINGs so that a sequence of them can be
536
536
// parsed into a []string.
537
- t .tag = tagPrintableString
538
- case tagGeneralizedTime , tagUTCTime :
537
+ t .tag = TagPrintableString
538
+ case TagGeneralizedTime , TagUTCTime :
539
539
// Likewise, both time types are treated the same.
540
- t .tag = tagUTCTime
540
+ t .tag = TagUTCTime
541
541
}
542
542
543
- if t .class != classUniversal || t .isCompound != compoundType || t .tag != expectedTag {
543
+ if t .class != ClassUniversal || t .isCompound != compoundType || t .tag != expectedTag {
544
544
err = StructuralError {"sequence tag mismatch" }
545
545
return
546
546
}
@@ -624,28 +624,28 @@ func parseField(v reflect.Value, bytes []byte, initOffset int, params fieldParam
624
624
return
625
625
}
626
626
var result interface {}
627
- if ! t .isCompound && t .class == classUniversal {
627
+ if ! t .isCompound && t .class == ClassUniversal {
628
628
innerBytes := bytes [offset : offset + t .length ]
629
629
switch t .tag {
630
- case tagPrintableString :
630
+ case TagPrintableString :
631
631
result , err = parsePrintableString (innerBytes )
632
- case tagIA5String :
632
+ case TagIA5String :
633
633
result , err = parseIA5String (innerBytes )
634
- case tagT61String :
634
+ case TagT61String :
635
635
result , err = parseT61String (innerBytes )
636
- case tagUTF8String :
636
+ case TagUTF8String :
637
637
result , err = parseUTF8String (innerBytes )
638
- case tagInteger :
638
+ case TagInteger :
639
639
result , err = parseInt64 (innerBytes )
640
- case tagBitString :
640
+ case TagBitString :
641
641
result , err = parseBitString (innerBytes )
642
- case tagOID :
642
+ case TagOID :
643
643
result , err = parseObjectIdentifier (innerBytes )
644
- case tagUTCTime :
644
+ case TagUTCTime :
645
645
result , err = parseUTCTime (innerBytes )
646
- case tagGeneralizedTime :
646
+ case TagGeneralizedTime :
647
647
result , err = parseGeneralizedTime (innerBytes )
648
- case tagOctetString :
648
+ case TagOctetString :
649
649
result = innerBytes
650
650
default :
651
651
// If we don't know how to handle the type, we just leave Value as nil.
@@ -671,9 +671,9 @@ func parseField(v reflect.Value, bytes []byte, initOffset int, params fieldParam
671
671
return
672
672
}
673
673
if params .explicit {
674
- expectedClass := classContextSpecific
674
+ expectedClass := ClassContextSpecific
675
675
if params .application {
676
- expectedClass = classApplication
676
+ expectedClass = ClassApplication
677
677
}
678
678
if offset == len (bytes ) {
679
679
err = StructuralError {"explicit tag has no child" }
@@ -709,10 +709,10 @@ func parseField(v reflect.Value, bytes []byte, initOffset int, params fieldParam
709
709
// type string. getUniversalType returns the tag for PrintableString
710
710
// when it sees a string, so if we see a different string type on the
711
711
// wire, we change the universal type to match.
712
- if universalTag == tagPrintableString {
713
- if t .class == classUniversal {
712
+ if universalTag == TagPrintableString {
713
+ if t .class == ClassUniversal {
714
714
switch t .tag {
715
- case tagIA5String , tagGeneralString , tagT61String , tagUTF8String :
715
+ case TagIA5String , TagGeneralString , TagT61String , TagUTF8String :
716
716
universalTag = t .tag
717
717
}
718
718
} else if params .stringType != 0 {
@@ -722,24 +722,24 @@ func parseField(v reflect.Value, bytes []byte, initOffset int, params fieldParam
722
722
723
723
// Special case for time: UTCTime and GeneralizedTime both map to the
724
724
// Go type time.Time.
725
- if universalTag == tagUTCTime && t .tag == tagGeneralizedTime && t .class == classUniversal {
726
- universalTag = tagGeneralizedTime
725
+ if universalTag == TagUTCTime && t .tag == TagGeneralizedTime && t .class == ClassUniversal {
726
+ universalTag = TagGeneralizedTime
727
727
}
728
728
729
729
if params .set {
730
- universalTag = tagSet
730
+ universalTag = TagSet
731
731
}
732
732
733
- expectedClass := classUniversal
733
+ expectedClass := ClassUniversal
734
734
expectedTag := universalTag
735
735
736
736
if ! params .explicit && params .tag != nil {
737
- expectedClass = classContextSpecific
737
+ expectedClass = ClassContextSpecific
738
738
expectedTag = * params .tag
739
739
}
740
740
741
741
if ! params .explicit && params .application && params .tag != nil {
742
- expectedClass = classApplication
742
+ expectedClass = ClassApplication
743
743
expectedTag = * params .tag
744
744
}
745
745
@@ -781,7 +781,7 @@ func parseField(v reflect.Value, bytes []byte, initOffset int, params fieldParam
781
781
case timeType :
782
782
var time time.Time
783
783
var err1 error
784
- if universalTag == tagUTCTime {
784
+ if universalTag == TagUTCTime {
785
785
time , err1 = parseUTCTime (innerBytes )
786
786
} else {
787
787
time , err1 = parseGeneralizedTime (innerBytes )
@@ -873,15 +873,15 @@ func parseField(v reflect.Value, bytes []byte, initOffset int, params fieldParam
873
873
case reflect .String :
874
874
var v string
875
875
switch universalTag {
876
- case tagPrintableString :
876
+ case TagPrintableString :
877
877
v , err = parsePrintableString (innerBytes )
878
- case tagIA5String :
878
+ case TagIA5String :
879
879
v , err = parseIA5String (innerBytes )
880
- case tagT61String :
880
+ case TagT61String :
881
881
v , err = parseT61String (innerBytes )
882
- case tagUTF8String :
882
+ case TagUTF8String :
883
883
v , err = parseUTF8String (innerBytes )
884
- case tagGeneralString :
884
+ case TagGeneralString :
885
885
// GeneralString is specified in ISO-2022/ECMA-35,
886
886
// A brief review suggests that it includes structures
887
887
// that allow the encoding to change midstring and
0 commit comments