1 2013-12-04: Antonio Borneo <borneo.antonio@gmail.com>
3 VPNC includes a wrapper around openssl and gnutls to
4 offer single set of crypto-API.
5 The program test-crypto.c is used to verify the API.
7 This folder "test" provides a chain of certificates
8 and an encrypted binary.
9 test-crypto.c verifies the certificate chain, decrypts
10 the binary and compare it against expected result.
11 See below for more details on how to use test-crypto.
13 openSSL is required to rebuild the test files.
14 To avoid the dependence from openSSL during SW compile,
15 all required files are distribuited together with the
18 The Makefile in this folder is able to rebuild all the
19 certificates and the binary.
21 to cleanup the folder and
23 to re-build everything from scratch.
24 Since both cryptographic keys and binary are generated
25 through random functions, results are not replicable
26 across executions. Use
28 if you want to cleanup the folder but keep either keys
35 To rebuild all following file.
36 - ca1.key ca2.key ca3.key:
37 Pairs of private and public keys, used for
38 certificate authorities.
39 - ca1.pem ca2.pem ca3.pem:
40 Self signed certificate of the certificate
43 Single file containing all the certificates
44 of the three CA above.
45 - cert0.key cert1.key cert2.key cert3.key:
46 Pairs of private and public keys, used for
48 - cert0.pem cert1.pem cert2.pem cert3.pem:
49 Certificates derived from ".key" files above.
50 Certificates are signed in chain:
51 ca3.pem -> cert0.pem -> cert1.pem ->
52 -> cert2.pem -> cert3.pem
53 Self signed certificate "ca3.pem" signs the
54 certificate "cert0.pem", that in turn signs
55 "cert1.pem", and so on.
57 Binary random data. File size equal to private
58 key size "cert0.key" (256 byte = 2048 bit).
60 Data from "dec_data.bin" RSA encrypted through
61 private key in "cert0.pem".
63 Temporarily config file for openSSL flags that
64 cannot be passed through command line.
66 The program test-crypto.c requires at least 5 arguments:
67 test-crypto <sig> <dec> <ca> <cert1> <server>
68 - <sig> is the encrypted binary;
69 - <dec> is the reference binary before encryption;
70 - <ca> is a list of CA certificates, one of them
72 - <cert1> ... <server> is the chain of certificates.