Chris, Slava, I read your query in the channel logs about the binding's unit tests. You'd expect them to be under the test folder, but I left .c related tests in there because I still need them for further development.
The factor unit tests are in fact under the main libs/cryptlib folder in the test.factor file. As stated earlier they cover every implemented feature. You run them as usual with "libs/cryptlib" test-module. The test will run and print out its results. It will block (until timeout) on the 'SSH session test' waiting for client input. Start the client connection in another terminal window with 'ssh -v localhost -p3000'. The test will block again on the 'SSL session test' waiting for client input. Start the client connection with 'curl -k https://localhost:3000'. cryptlib's network operations are non-blocking and near-asynchronous, waiting only the minimum amount of time for data to be sent or received before returning to the caller and we can also pass it our own sockets (it usually handles its own I/O). If you want to run the test again you should clean the [localhost]:3000 ssh-rsa entry in the known_hosts file, in your home directory under the .ssh folder, since the test generates a new RSA certificate on every run. I have pasted the unit tests' typical output below. Kindest regards, Elie ssh -v localhost -p3000 ... The authenticity of host '[localhost]:3000 ([::1]:3000)' can't be established. RSA key fingerprint is 39:e8:89:18:55:c0:f1:9f:e7:64:ee:d8:30:89:96:7a. Are you sure you want to continue connecting (yes/no)? yes ... @localhost's password: (any password will be accepted) debug1: Authentication succeeded (password). debug1: channel 0: new [client-session] debug1: Entering interactive session. Welcome to cryptlib, now go away. curl -k https://localhost:3000 Welcome to cryptlib, now go away. ( scratchpad ) "libs/cryptlib" test-module Loading module libs/cryptlib Loading P" resource:libs/cryptlib/load.factor" Loading P" resource:libs/cryptlib/libcl.factor" Loading P" resource:libs/cryptlib/cryptlib.factor" Compiling 837 words... Compile finished. :errors - print 0 compiler errors. :warnings - print 0 compiler warnings. Loading P" resource:libs/cryptlib/test.factor" Compiling 3 words... Compile finished. :errors - print 0 compiler errors. :warnings - print 0 compiler warnings. ========================================================= Envelope/de-envelop test... ========================================================= 11 28 "0\u001a\u0006\t*\u0086H\u0086\u00f7\r\u0001\u0007\u0001\u00a0\r\u0004\u000bHello world" 28 11 { [ "Hello world" ] [ pop-buffer-string ] } 0 ms run / 0 ms GC time ========================================================= Password encryption test... ========================================================= 11 183 "0\u0081\u00b4\u0006\t*\u0086H\u0086\u00f7\r\u0001\u0007\u0003\u00a0\u0081\u00a60\u0081\u00a3\u0002\u0001" 183 11 { [ "Hello world" ] [ pop-buffer-string ] } 1 ms run / 0 ms GC time ========================================================= Compression test... ========================================================= 11 87 "0\u0080\u0006\u000b*\u0086H\u0086\u00f7\r\u0001\t\u0010\u0001\t\u00a0\u00800\u0080\u0002\u0001" 87 11 { [ "Hello world" ] [ pop-buffer-string ] } 0 ms run / 0 ms GC time ========================================================= Conventional encryption test... ========================================================= 11 78 "0L\u0006\t*\u0086H\u0086\u00f7\r\u0001\u0007\u0006\u00a0?0=\u0002\u0001" 78 11 { [ "Hello world" ] [ pop-buffer-string ] } 0 ms run / 0 ms GC time ========================================================= Large data size envelope/de-envelop test... ========================================================= 128471 128497 128497 128471 { [ "/opt/local/lib/libcl.dylib(dylib1.o):" ] [ pop-buffer-string "\n" split first ] } 168 ms run / 0 ms GC time { [ "00000000 t __mh_dylib_header" ] [ pop-buffer-string "\n" split last/first first ] } 168 ms run / 9 ms GC time ========================================================= Large data size password encryption test... ========================================================= 128471 128651 "0\u0083\u0001\u00f6\u0086\u0006\t*\u0086H\u0086\u00f7\r\u0001\u0007\u0003\u00a0\u0083\u0001\u00f6v0\u0083\u0001\u00f6q\u0002\u0001" 128651 128471 { [ "/opt/local/lib/libcl.dylib(dylib1.o):" ] [ pop-buffer-string "\n" split first ] } 163 ms run / 0 ms GC time { [ "00000000 t __mh_dylib_header" ] [ pop-buffer-string "\n" split last/first first ] } 165 ms run / 0 ms GC time ========================================================= Generating a key pair test... ========================================================= Passed ========================================================= Simple certificate creation test... ========================================================= -----BEGIN CERTIFICATE----- MIICBDCCAW2gAwIBAgIIbOvEMhJQSMEwDQYJKoZIhvcNAQEFBQAwFTETMBEGA1UE AxMKRGF2ZSBTbWl0aDAeFw0wNzA1MTQwODEyMDhaFw0yNzA1MDkwODEyMDhaMBUx EzARBgNVBAMTCkRhdmUgU21pdGgwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB AOOFrh9R4EH1y+BJ/rpgCNvmbUQ63AxogDoPX1Chi03Ir4aG/yNguMY3jDVPHefr qnwyWzcQalWX7ckdz7Ok2MjJYtsDYEo/qSOpKJ0TQpx/mWmQMzI5OAGEe6VwRee8 Jg2xr+CK5qw09L+8PbmjFJPUQY2LLYSwb3EHe0chhuixAgMBAAGjXTBbMB0GA1Ud DgQWBBTnJ4NfDn4h3soRrF/CZcfNsFHs1TAOBgNVHQ8BAf8EBAMCAeYwDwYDVR0T AQH/BAUwAwEB/zAZBgNVHSAEEjAQMA4GDCsGAQQBl1VYWVpaWTANBgkqhkiG9w0B AQUFAAOBgQDe2OKXpsqvih8QzIMvwvr+dOR8rJfRMNPAxImHhEfS9+nGs4ZCWGKl +/3nKY2NuGWSDWIS55bcM1TJe0ObrIwTeTsGq1zeXXPIS2107+Vl6GmZXgEHwEt2 OrUBNBuxy/glI1EPdE1Y/KIRT5IkflXCZ6GD+l8aAQeSfs5b94ACLA== -----END CERTIFICATE----- ========================================================= SSH session test... ========================================================= Passed ========================================================= SSL session test... ========================================================= Passed ( scratchpad ) _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
