Manuel Pégourié-Gonnard
c296c5925e
Introduce generic x509_get_pubkey()
2013-07-17 15:59:40 +02:00
Manuel Pégourié-Gonnard
094ad9e512
Rename x509_get_pubkey to _rsa and split it up
2013-07-17 15:59:40 +02:00
Manuel Pégourié-Gonnard
f16ac763f6
Simplify length mismatch check in x509_get_pubkey
2013-07-17 15:59:40 +02:00
Manuel Pégourié-Gonnard
20c12f6b5f
Factor more code into x509_get_pubkey()
2013-07-17 15:59:40 +02:00
Manuel Pégourié-Gonnard
788db112a5
Get rid of x509_cert.pkoid
...
Unused, comment did not match reality, and will soon be superseeded by the
'type' field of the pk_context which will replace rsa_context.
2013-07-17 15:59:39 +02:00
Manuel Pégourié-Gonnard
374e4b87d4
pk_set_type() cannot be used to reset key type
2013-07-17 15:59:39 +02:00
Manuel Pégourié-Gonnard
0a64e8f1fd
Rework algorithmIdentifier parsing
2013-07-17 15:59:39 +02:00
Paul Bakker
f4a1427ae7
base64_decode() also forcefully returns on dst == NULL
2013-07-16 17:48:58 +02:00
Paul Bakker
82024bf7b9
ssl_server2 now uses alloc_buffer if present and can be 'SERVERQUIT'
2013-07-16 17:48:58 +02:00
Paul Bakker
61d113bb7b
Init and free new contexts in the right place for SSL to prevent
...
memory leaks
2013-07-16 17:48:58 +02:00
Paul Bakker
8647eecf90
Merge branch 'parse-ec-key' into development
2013-07-16 17:48:18 +02:00
Paul Bakker
8ea6c61477
Rename of prvkey -> privkey fix in test suite files
2013-07-16 17:16:58 +02:00
Manuel Pégourié-Gonnard
7d4e5b739e
Simplify password check in pem_read_buffer()
2013-07-09 16:42:35 +02:00
Manuel Pégourié-Gonnard
791eed3f33
Fix portability issue in oid_get_numeric_string()
2013-07-09 16:42:35 +02:00
Manuel Pégourié-Gonnard
de44a4aecf
Rename ecp_check_prvkey with a 'i' for consistency
2013-07-09 16:42:34 +02:00
Manuel Pégourié-Gonnard
81c313ccc6
Add #ifdef's on RSA and EC in PK
2013-07-09 10:49:09 +02:00
Manuel Pégourié-Gonnard
1f73a65c06
Fix ommission in pk_free().
2013-07-09 10:42:13 +02:00
Manuel Pégourié-Gonnard
7a6c946446
Fix error code in pk.h
2013-07-09 10:37:27 +02:00
Manuel Pégourié-Gonnard
8838099330
Add x509parse_{,public}_key{,file}()
...
Also make previously public *_ec functions private.
2013-07-08 17:32:27 +02:00
Manuel Pégourié-Gonnard
12e0ed9115
Add pk_context and associated functions
2013-07-08 17:32:27 +02:00
Manuel Pégourié-Gonnard
d4ec21dd47
Add a check for multiple curve specification
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
80300ad0d9
Add checks for pk_alg.
...
Used to be implicitly done by oid_get_pk_alg().
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
a9e54129b5
Adapt test files to supported PKCS#8 modes
...
openssl pkcs8 -topk8 -in ec_prv.sec1.pem -passout pass:polar \
-v1 PBE-SHA1-RC4-128 -outform der -out ec_prv.pk8.pw.der
openssl pkcs8 -topk8 -in ec_prv.sec1.pem -passout pass:polar \
-v1 PBE-SHA1-RC4-128 -outform pem -out ec_prv.pk8.pw.pem
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
9c1cf459dd
Implement x509parse_key_pkcs8_encrypted_der_ec()
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
a5d9974423
Split up x509_parse_pkcs8_encrypted_der()
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
416fa8fde5
Implement x509parse_key_pkcs8_unencrypted_der_ec()
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
f8648d51b1
Fix undocumented feature of pem_read_buffer()
...
Used to work only for RSAPrivateKey content, now accepts ECPrivateKey too,
and may even work with similar enough structures when they appear.
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
e366342233
Implement x509parse_key_sec1_der()
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
2b9252cd8f
Add tests for x509parse_key_ec()
...
Test files were generated as follows:
openssl ecparam -name prime192v1 -genkey > key.pem
openssl ec -in key.pem -pubout -outform PEM > pub.pem
openssl ec -in key.pem -pubout -outform DER > pub.der
openssl ec -in key.pem -outform pem > prv.sec1.pem
openssl ec -in key.pem -outform der > prv.sec1.der
openssl ec -in key.pem -des -passout pass:polar -outform pem > prv.sec1.pw.pem
openssl pkcs8 -topk8 -in key.pem -nocrypt -outform pem > prv.pk8.pem
openssl pkcs8 -topk8 -in key.pem -nocrypt -outform der > prv.pk8.der
openssl pkcs8 -topk8 -in key.pem -passout pass:polar -outform der \
> prv.pk8.pw.der
openssl pkcs8 -topk8 -in key.pem -passout pass:polar -outform pem \
> prv.pk8.pw.pem
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
15e8b82724
Fill in x509parse_key_ec using stub function
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
73c0cda346
Complete x509parse_public_key_ec()
...
Warning: due to a bug in oid_descriptor_from_buf(), keys associated to some
curves (secp224r1, secp384r1, secp521r1) are incorrectly rejected,
since their namedCurve OID contains a nul byte.
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
f838eeda09
Add x509_get_ecparams()
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
f0b30d0542
Add oid_get_ec_grp() and associated data
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
5a9b82e234
Make oid_get_pk_alg handle EC algorithms
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
dffba8f63e
Fix bug in oid_get_numeric_string()
...
Overflow check was done too early, causing many false positives.
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
444b42710a
Optionally allow parameters in x509_get_tag()
2013-07-08 17:32:26 +02:00
Manuel Pégourié-Gonnard
1bc6931f8c
Add test for x509parse_public_keyfile_ec
2013-07-08 15:31:19 +02:00
Manuel Pégourié-Gonnard
26833c2fc6
Add stubs for x509parse_key_ec and co.
2013-07-08 15:31:19 +02:00
Manuel Pégourié-Gonnard
4250a1f818
Fix a comment and some whitespace
2013-07-08 15:31:18 +02:00
Manuel Pégourié-Gonnard
ba4878aa64
Rename x509parse_key & co with _rsa suffix
2013-07-08 15:31:18 +02:00
Manuel Pégourié-Gonnard
c8dc295e83
Add ecp_check_prvkey, with test
...
Also group key checking and generation functions in ecp.h and ecp.c.
2013-07-08 15:31:18 +02:00
Manuel Pégourié-Gonnard
b8c6e0e3e9
Add ecp_keypair struct, init/free and constants
2013-07-08 15:31:18 +02:00
Manuel Pégourié-Gonnard
7c8934ea0e
Add ecdsa_init and ecdsa_free
2013-07-08 15:30:23 +02:00
Manuel Pégourié-Gonnard
bec2f45cfc
Add ecdsa_context structure
2013-07-08 15:30:23 +02:00
Paul Bakker
44618dd798
SSL Test and Benchmark now handle missing POLARSSL_TIMING_C
2013-07-04 11:30:32 +02:00
Paul Bakker
1ef120f5fd
Updated buffer-allocator with free-block-list to speed up searches
2013-07-03 17:22:32 +02:00
Paul Bakker
41350a9a7e
Fixed spaces in memory_buffer_alloc.c
2013-07-03 17:22:32 +02:00
Paul Bakker
fa9b10050b
Also compiles / runs without time-based functions in OS
...
Can now run without need of time() / localtime() and gettimeofday()
2013-07-03 17:22:32 +02:00
Paul Bakker
ecd54fb897
Disable POLARSSL_TIMING_C by default (only required for HAVEGE)
2013-07-03 17:22:31 +02:00
Paul Bakker
92b8dc0535
Fixed memory leaks in tests
2013-07-03 17:22:31 +02:00