rusticata / der-parser

BER/DER parser written in pure Rust. Fast, zero-copy, safe.
Apache License 2.0
85 stars 28 forks source link

Add string verification and as_str() #21

Closed jannschu closed 4 years ago

jannschu commented 5 years ago

Contains first draft for some changes suggested in #16. See changes in README.

jannschu commented 5 years ago

I have a version rebased on #18 and can force-push that.

chifflier commented 5 years ago

Hi, This PR is quite interesting, as it helps accessing string data. Originally, I used slices to be able to parsed malformed objects, but it makes more sense to actually check the characters. A quick look makes me thing we should add new error types, because using BerValueError would be too generic (and hard to debug). I'll have a deeper look soon.

chifflier commented 4 years ago

Merged in 02c04e5 with some fixes (please don't forget to run rustfmt and cargo clippy), and targeted for 4.0 Thanks for your contribution!