Log in

No account? Create an account
"I am only an egg." [entries|archive|friends|userinfo]
Valery V. Vorotyntsev

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Links:| reader delicious lastfm ]

announcing under.c [Jun. 8th, 2010|06:04 pm]
Valery V. Vorotyntsev
[Tags|, , , , ]

`under' utility decodes binary DER data to S-expressions and/or encodes those back to DER.

Aren't you curious of how iteratees may look in C?

$ echo '(p1 (p2 "48 45 4c 4c 4f") (p3 ""))' | under -e | hexdump -C
00000000  e1 09 c2 05 48 45 4c 4c  4f c3 00                 |....HELLO..|
$ ^hexdump -C^openssl asn1parse -inform DER -i
    0:d=0  hl=2 l=   9 cons: priv [ 1 ]        
    2:d=1  hl=2 l=   5 prim:  priv [ 2 ]        
    9:d=1  hl=2 l=   0 prim:  priv [ 3 ]        

Homepage: http://github.com/vvv/under.c
Tag: implemented-in::c, interface::commandline, role::program, scope::utility, works-with-format::der


[User Picture]From: jtootf
2010-06-08 03:06 pm (UTC)
yes I am
(Reply) (Thread)
[User Picture]From: vorotylo
2010-06-08 03:15 pm (UTC)
Use the source, Luke.
(Reply) (Parent) (Thread)
[User Picture]From: lionet
2010-06-08 06:27 pm (UTC)
Ну, положим, утилитам unber и enber года уже исполнились ;)

Впрочем, подход очень здравый. Я бы его и заюзал, если бы знал тогда про iteratees (осень 2009 или около того). Теперь вот знаю, но до asn1c всё руки не доходят.
(Reply) (Thread)
[User Picture]From: vorotylo
2010-06-09 07:31 am (UTC)

> Ну, положим, утилитам unber и enber года уже исполнились

Они у меня установлены.

$ dpkg -s asn1c
Package: asn1c
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 1372
Maintainer: W. Martin Borgert <debacle@debian.org>
Architecture: i386
Version: 0.9.21.dfsg-4
Depends: libc6 (>= 2.7-1)
Description: ASN.1 compiler for C
 This ASN.1 compiler turns the formal ASN.1 specifications
 into the C code.  The compiler is shipped together with
 conformant BER/DER/XER codecs.  The X.509 and GSM TAP3
 decoding examples are shipped as well.
Homepage: http://asn1c.sourceforge.net/

`under' писалсо с мыслию о тебе, Лёвушко. :)

(Reply) (Parent) (Thread)
[User Picture]From: lionet
2010-06-09 09:51 am (UTC)
А нафига DER, кстати, а не BER?
(Reply) (Parent) (Thread)
[User Picture]From: vorotylo
2010-06-09 09:59 am (UTC)
Да у меня тут на работе BER-а нет, зачем же ненужное кодировать. (Indefinite form of length всякие.)
(Reply) (Parent) (Thread)
[User Picture]From: lionet
2010-06-09 10:11 am (UTC)
(Reply) (Parent) (Thread)