Integer of 128 (0x80) must be encoded as 0x00 0x80. It effectively applies to all numbers which have the highest bit set to 1 (not only to 128 obviously).
It impacts your asn1.go functions sizeInt64/writeInt64.
I quickly workarounded this item in your lib
func sizeInt64(i int64) (size int) {
prev := int64(0)
for ; i != 0 || size == 0; i >>= 8 {
size++
prev = i
}
if prev&0x80 == 0x80 {
size++
}
return
}
func writeInt64(bytes *Bytes, i int64) (size int) {
prev := int64(0)
for ; i != 0 || size == 0; i >>= 8 { // Write at least one byte even if the value is 0
bytes.writeBytes([]byte{byte(i)})
size++
prev = i
}
if prev&0x80 == 0x80 {
bytes.writeBytes([]byte{byte(0)})
size++
}
return
}
Integer of 128 (0x80) must be encoded as 0x00 0x80. It effectively applies to all numbers which have the highest bit set to 1 (not only to 128 obviously).
It impacts your asn1.go functions sizeInt64/writeInt64.
I quickly workarounded this item in your lib