Giter Site home page Giter Site logo

hexio's People

Contributors

vanrein avatar

Stargazers

 avatar  avatar

Watchers

 avatar

hexio's Issues

derdump on negative integers

The pretty printer for INTEGER types always produces unsigned output. For instance,
0x02 0x01 0xff
is printed as 255 rather than -1.

To reproduce:

shell$ hexin  > /tmp/negint.der
00000000> 02 01 ff
00000003> ^D

shell$ derdump /tmp/negint.der
INTEGER: tag 0x02 #1 @0 ^0, Universal, Primitive
   ff == 255

Use pkgconfig

Please use pkgconfig for obtaining build flags. The makefile hardcodes /usr/include/PCSC, which is does not work on NixOS, which uses a different path. pkg-config --cflags --libs libpcsclite will produce a correct flags.

"llcio.c" not working

Hi vanrein,

I tried to run "llcio.c" on my system (Ubuntu 19.10) but it would be stuck at "accept". Maybe my system has bugs. Do you know on which system I can successfully run this program?

Thanks!

derdump.py -- negative INTEGER values

The INTEGER printing routine in derdump only works for positive integers. Should initialise to -1 when the first content byte's highest bit is set. (Given that such a first byte exists, so length>0)

Could use b64in / b64out

The hexin routine could be cloned to a b64in, with addresses ending in .25 and such. Or, in hex, .0 .4 .8 and .c :-)
Similarly, hexout to b64out. This mirrors well with previous change of command names inputter to hexin and outputter to hexout.

user experience improvements (hexin / b64in)

A few ideas for improving the humanity of the tool:

  • skip the wait when data is already being presented (as in copy/paste)
  • try to get better looks; perhaps suppress echo and do it explicitly
  • when suppressing echo, we can actually provide stylish output:
    • limit lines to 16 well-formatted hex characters, plus ASCII output, like hd
    • space forward lines with half-way addresses to their normal column
  • print a space character after the prompt
  • print an explicit ^D (or a mere newline) when the input is terminated

The same would apply to b64in, of course. Except that its addresses are a bit weird, including partials.

could use hexcut

Annotations of the output as from hd or hexout can be extremely useful in reading them. An example follows below. It would be nice to have a tool to do such things for us. This might involve searching for tags, reading lengths and so on; the trick will be to keep it simple...

00000000  83 21 00 00 01 65
          ^ NDEF header, first record, URI typed
             ^ type length 0x21 == 33
                ^ payload length 0x00000165 == 357
                            75 72  6e 3a 6e 66 63 3a 65 78  |.!...eurn:nfc:ex|
00000010  74 3a 61 72 70 61 32 2e  6f 72 67 3a 6b 72 62 35  |t:arpa2.org:krb5|
00000020  3a 74 69 63 6b 65 74
                            ^ URI type
                               61  82 01 61 30 82 01 5d a0  |:ticketa..a0..].|
00000030  03 02 01 05 a1 0b 1b 09  41 52 50 41 32 2e 4e 45  |........ARPA2.NE|
00000040  54 a2 21 30 1f a0 03 02  01 01 a1 18 30 16 1b 04  |T.!0........0...|
00000050  78 6d 70 70 1b 0e 78 6d  70 70 2e 61 72 70 61 32  |xmpp..xmpp.arpa2|
00000060  2e 6e 65 74 a3 82 01 24  30 82 01 20 a0 03 02 01  |.net...$0.. ....|
00000070  12 a1 03 02 01 03 a2 82  01 12 04 82 01 0e 30 29  |..............0)|
00000080  4c 30 d0 35 66 bf e9 5c  90 45 86 54 5d c5 b3 c9  |L0.5f..\.E.T]...|
00000090  8b f1 52 db 36 92 fc b1  6f a5 51 01 c8 78 26 a8  |..R.6...o.Q..x&.|
000000a0  12 12 44 38 00 da 75 18  ba 50 14 89 4b 79 bd 71  |..D8..u..P..Ky.q|
000000b0  ac 12 3b 76 17 10 f6 11  57 05 b5 84 94 86 62 55  |..;v....W.....bU|
000000c0  ce 8d f0 10 f4 91 7c 6c  57 ed d2 00 3f 32 e6 17  |......|lW...?2..|
000000d0  4d f1 5a 8e c5 f9 ef 77  5e 02 d4 6d ee 78 85 cf  |M.Z....w^..m.x..|
000000e0  ad f3 31 03 98 89 86 c2  0c cb 7d 02 8f 55 08 3c  |..1.......}..U.<|
000000f0  16 e2 e9 69 86 bc af fe  39 08 05 94 4f 42 e0 22  |...i....9...OB."|
00000100  57 66 81 ed c0 5c d6 46  1d eb ff a0 79 a8 3d 98  |Wf...\.F....y.=.|
00000110  ba a7 48 80 6e 1c f5 a5  fb 2f 44 8b 4d e2 f1 de  |..H.n..../D.M...|
00000120  9c ce ea 59 4e 3a d0 70  df 79 71 e0 db 24 cd 24  |...YN:.p.yq..$.$|
00000130  d7 46 c7 d4 28 10 9e ea  e2 6c ad 4b 33 b9 ad 51  |.F..(....l.K3..Q|
00000140  3b b2 01 47 83 2d 74 36  2b 4d a4 f9 5d e6 e3 60  |;..G.-t6+M..]..`|
00000150  3d ca a4 9b 87 43 a4 46  82 99 71 c4 64 07 c4 88  |=....C.F..q.d...|
00000160  d7 a2 86 ef 3a 83 36 54  e8 97 21 cf 32 3f 7f 97  |....:.6T..!.2?..|
00000170  8f 3d a3 00 6b b8 c7 b6  fc 7e 2e 35 dc c4 c5 ae  |.=..k....~.5....|
00000180  ee 53 7d a0 14 d3 65 6d  9c 83 1c af
                  payload      ^
                                               43 2f 00 00  |.S}...em....C/..|
          NDEF header, last record, URI typed  ^
          type length 0x2f == 47                  ^
00000190  01 06
          payload length 0x106 == 262                ^
                75 72 6e 3a 6e 66  63 3a 65 78 74 3a 61 72  |..urn:nfc:ext:ar|
000001a0  70 61 32 2e 6f 72 67 3a  6b 72 62 35 3a 65 6e 63  |pa2.org:krb5:enc|
000001b0  74 69 63 6b 65 74 70 61  72 74 3a 6b 65 79 74 61  |ticketpart:keyta|
000001c0  62
                ^ type URI
             30 82 01 02 a0 03 02  01 12 a1 03 02 01 02 a2  |b0..............|
000001d0  81 f5 04 81 f2 86 cc d8  e3 78 62 23 6d 56 47 4a  |.........xb#mVGJ|
000001e0  2b ce 63 41 9a ec 6f be  f3 c5 18 86 20 65 09 a4  |+.cA..o..... e..|
000001f0  c2 1e c3 05 1f 8e ac 80  44 42 d3 b3 a1 63 6e a2  |........DB...cn.|
00000200  6b ce 53 c4 48 59 28 25  12 df e9 df 02 1b fa 57  |k.S.HY(%.......W|
00000210  14 75 8a c0 63 09 41 60  59 c5 8b 54 5b ce 22 a2  |.u..c.A`Y..T[.".|
00000220  3a 9c 11 4d d8 46 3e a3  0f 1e 75 a3 83 71 8c 11  |:..M.F>...u..q..|
00000230  5b 9a f3 27 2a c0 4a d5  32 2f 95 24 56 cb 09 c5  |[..'*.J.2/.$V...|
00000240  4d cf 3b de ce 46 18 a0  85 e6 3c 8d f1 3b 9c 37  |M.;..F....<..;.7|
00000250  60 a7 65 e0 aa ff 7d 8d  63 ef f5 0e 94 fe 26 66  |`.e...}.c.....&f|
00000260  89 40 81 07 0e 61 96 03  0b f7 c3 4d ab f9 dd 9e  |[email protected]....|
00000270  ca 21 e6 ab 65 eb ef 54  4b 1a 9a 52 ab df 4f 1f  |.!..e..TK..R..O.|
00000280  9f 9e 07 c5 d6 6b 05 7d  8a 0d 35 dd c3 31 2d 91  |.....k.}..5..1-.|
00000290  75 b7 06 d2 da 57 66 fa  a8 5a 55 b5 c9 72 e1 bf  |u....Wf..ZU..r..|
000002a0  88 3d 89 c3 52 9e d3 37  bc ed fe 80 2a d8 0f 9e  |.=..R..7....*...|
000002b0  76 4d 9f be 44 61 19 a9  bc 8a b9 25 89 20 55 af  |vM..Da.....%. U.|
000002c0  37 75 1e d9 22 7e 6c                              |7u.."~l|
             ^ payload
000002c7

Incorporate ASN.1 grammar

Make use of Quick DER generated structures (which can include Python classes).

Introduced in 083f785 off the main branch but not free from issues:

  1. Sometimes printing 1st field name before structure to be entered.
  2. Need guidance for entry into PRIMITIVE structures such as OCTETSTRING or BITSTRING.
  3. Need guidance for (printing of, and) type matching for ANY.
  4. Need to retain _TYPTR for named type definitions such as LDAPDN.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.