mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 09:27:59 +00:00
5b14abc30e
I've written a new standalone test program which incorporates all of PuTTY's crypto code, including the mp_int and low-level elliptic curve layers but also going all the way up to the implementations of the MAC, hash, cipher, public key and kex abstractions. The test program itself, 'testcrypt', speaks a simple line-oriented protocol on standard I/O in which you write the name of a function call followed by some inputs, and it gives you back a list of outputs preceded by a line telling you how many there are. Dynamically allocated objects are assigned string ids in the protocol, and there's a 'free' function that tells testcrypt when it can dispose of one. It's possible to speak that protocol by hand, but cumbersome. I've also provided a Python module that wraps it, by running testcrypt as a persistent subprocess and gatewaying all the function calls into things that look reasonably natural to call from Python. The Python module and testcrypt.c both read a carefully formatted header file testcrypt.h which contains the name and signature of every exported function, so it costs minimal effort to expose a given function through this test API. In a few cases it's necessary to write a wrapper in testcrypt.c that makes the function look more friendly, but mostly you don't even need that. (Though that is one of the motivations between a lot of API cleanups I've done recently!) I considered doing Python integration in the more obvious way, by linking parts of the PuTTY code directly into a native-code .so Python module. I decided against it because this way is more flexible: I can run the testcrypt program on its own, or compile it in a way that Python wouldn't play nicely with (I bet compiling just that .so with Leak Sanitiser wouldn't do what you wanted when Python loaded it!), or attach a debugger to it. I can even recompile testcrypt for a different CPU architecture (32- vs 64-bit, or even running it on a different machine over ssh or under emulation) and still layer the nice API on top of that via the local Python interpreter. All I need is a bidirectional data channel.
152 lines
1.8 KiB
Plaintext
152 lines
1.8 KiB
Plaintext
*.o
|
|
*.pyc
|
|
.dirstamp
|
|
.deps
|
|
.DS_Store
|
|
/*.pdb
|
|
/*.ilk
|
|
/*.res
|
|
/*.RES
|
|
/*.pch
|
|
/*.rsp
|
|
/*.obj
|
|
/*.exe
|
|
/*.ncb
|
|
/*.plg
|
|
/*.dsw
|
|
/*.opt
|
|
/*.dsp
|
|
/*.tds
|
|
/*.td2
|
|
/*.map
|
|
/Makefile.mgw
|
|
/Makefile.vc
|
|
/Makefile.lcc
|
|
/MSVC
|
|
/*.log
|
|
/*.GID
|
|
/local
|
|
/Output
|
|
/pageant
|
|
/plink
|
|
/pscp
|
|
/psftp
|
|
/putty
|
|
/puttytel
|
|
/puttygen
|
|
/pterm
|
|
/puttyapp
|
|
/ptermapp
|
|
/osxlaunch
|
|
/uppity
|
|
/unix/PuTTY.app
|
|
/unix/Pterm.app
|
|
/fuzzterm
|
|
/testcrypt
|
|
/testzlib
|
|
/cgtest
|
|
/*.DSA
|
|
/*.RSA
|
|
/*.cnt
|
|
/*.hlp
|
|
/.bmake
|
|
/build.log
|
|
/build.out
|
|
/uxconfig.h
|
|
/empty.h
|
|
/config.status
|
|
/Makefile.am
|
|
/Makefile.in
|
|
/Makefile
|
|
/compile
|
|
/config.status
|
|
/configure
|
|
/stamp-h1
|
|
/aclocal.m4
|
|
/ar-lib
|
|
/autom4te.cache
|
|
/depcomp
|
|
/install-sh
|
|
/local
|
|
/missing
|
|
/uxconfig.in
|
|
/uxconfig.h
|
|
/licence.h
|
|
/*.a
|
|
/charset/sbcsdat.c
|
|
/contrib/cygtermd/cygtermd.exe
|
|
/doc/*.html
|
|
/doc/*.txt
|
|
/doc/*.cnt
|
|
/doc/*.hlp
|
|
/doc/*.gid
|
|
/doc/*.GID
|
|
/doc/*.chm
|
|
/doc/*.log
|
|
/doc/*.1
|
|
/doc/*.info
|
|
/doc/vstr.but
|
|
/doc/*.hhp
|
|
/doc/*.hhc
|
|
/doc/*.hhk
|
|
/doc/licence.but
|
|
/doc/copy.but
|
|
/icons/*.pam
|
|
/icons/*.png
|
|
/icons/*.ico
|
|
/icons/*.icns
|
|
/icons/*.xpm
|
|
/icons/*.c
|
|
/unix/Makefile.gtk
|
|
/unix/Makefile.ux
|
|
/unix/Makefile.local
|
|
/unix/empty.h
|
|
/unix/plink
|
|
/unix/pterm
|
|
/unix/putty
|
|
/unix/puttytel
|
|
/unix/psftp
|
|
/unix/pscp
|
|
/unix/puttygen
|
|
/unix/stamp-h1
|
|
/unix/*.log
|
|
/unix/.deps
|
|
/windows/*.pdb
|
|
/windows/*.ilk
|
|
/windows/*.res
|
|
/windows/*.RES
|
|
/windows/*.pch
|
|
/windows/*.rsp
|
|
/windows/*.obj
|
|
/windows/*.exe
|
|
/windows/*.ncb
|
|
/windows/*.plg
|
|
/windows/*.dsw
|
|
/windows/*.opt
|
|
/windows/*.dsp
|
|
/windows/*.tds
|
|
/windows/*.td2
|
|
/windows/*.map
|
|
/windows/Makefile.clangcl
|
|
/windows/Makefile.mgw
|
|
/windows/Makefile.vc
|
|
/windows/Makefile.lcc
|
|
/windows/MSVC
|
|
/windows/DEVCPP
|
|
/windows/VS2010
|
|
/windows/VS2012
|
|
/windows/*.log
|
|
/windows/*.GID
|
|
/windows/local
|
|
/windows/Output
|
|
/windows/*.DSA
|
|
/windows/*.RSA
|
|
/windows/*.cnt
|
|
/windows/*.hlp
|
|
/windows/.bmake
|
|
/windows/*.sln
|
|
/windows/*.suo
|
|
/windows/*.msi
|
|
/windows/*.wixobj
|
|
/windows/*.wixpdb
|