Merge pull request 'Use Cstruct.length and require cstruct >= 6.0.0' (#56) from cstruct.6.0.0 into main
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/56
This commit is contained in:
commit
cdce07c808
2 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@ build: [
|
||||||
depends: [
|
depends: [
|
||||||
"builder"
|
"builder"
|
||||||
"dream" {>= "1.0.0~alpha2"}
|
"dream" {>= "1.0.0~alpha2"}
|
||||||
|
"cstruct" {>= "6.0.0"}
|
||||||
"bos"
|
"bos"
|
||||||
"hex"
|
"hex"
|
||||||
"caqti"
|
"caqti"
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Asn = struct
|
||||||
let decode_strict codec cs =
|
let decode_strict codec cs =
|
||||||
match Asn.decode codec cs with
|
match Asn.decode codec cs with
|
||||||
| Ok (a, cs) ->
|
| Ok (a, cs) ->
|
||||||
if Cstruct.len cs = 0
|
if Cstruct.length cs = 0
|
||||||
then Ok a
|
then Ok a
|
||||||
else Error "trailing bytes"
|
else Error "trailing bytes"
|
||||||
| Error (`Parse msg) -> Error ("parse error: " ^ msg)
|
| Error (`Parse msg) -> Error ("parse error: " ^ msg)
|
||||||
|
|
Loading…
Reference in a new issue