Love Hörnquist Åstrand
e59e71f307
Allow setting parameters to private key generation.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19871 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-12 22:01:58 +00:00
Love Hörnquist Åstrand
82a45c7036
constify
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19839 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-11 09:55:09 +00:00
Love Hörnquist Åstrand
9efb0df9f1
remove no longer used stuff, move set_digest_alg here from cms.c since
...
its only used here.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19836 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-11 09:35:25 +00:00
Love Hörnquist Åstrand
80977a02f6
Factor out private key operation out of the signing, operations, support import, export, and generation of private keys. Add support for writing PEM and PKCS12 files with private keys in them.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19778 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-09 10:52:13 +00:00
Love Hörnquist Åstrand
1c95c59dab
Add _hx509_create_signature_bitstring.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19563 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-29 15:53:42 +00:00
Love Hörnquist Åstrand
7a0fadc477
(_hx509_private_key_assign_rsa): set a default sig alg
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19301 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-09 12:56:34 +00:00
Love Hörnquist Åstrand
e99ef09706
(rsa_create_signature): Abort when signature is longer, not shorter.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19235 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-06 10:23:14 +00:00
Love Hörnquist Åstrand
1d8f59cfa1
sprinkle more error strings
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19171 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-28 12:00:08 +00:00
Love Hörnquist Åstrand
444753045a
use unsigned int as counter to fit better with the asn1 compiler
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19166 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-28 03:59:34 +00:00
Love Hörnquist Åstrand
d51986d91e
rewrite comment to make more sense
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19159 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-27 14:11:03 +00:00
Love Hörnquist Åstrand
18b698ae86
(hx509_crypto_select): check sig_algs[j]->key_oid
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19157 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-27 13:29:19 +00:00
Love Hörnquist Åstrand
cbcc5adfc3
(hx509_crypto_available): let alg pass if its keyless
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19153 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-27 12:14:07 +00:00
Love Hörnquist Åstrand
93f60d5dae
(hx509_crypto_available): use right index.
...
(hx509_crypto_free_algs): new function
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19139 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-27 10:36:04 +00:00
Love Hörnquist Åstrand
8fea309b05
(hx509_crypto_select): improve
...
(hx509_crypto_available): new function
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19137 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-27 10:16:05 +00:00
Love Hörnquist Åstrand
0a531062bd
print return value for RSA_private_decrypt
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19134 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-27 08:30:53 +00:00
Love Hörnquist Åstrand
e37704f850
Sprinkle error string and hx509_contexts.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19128 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-26 17:53:25 +00:00
Love Hörnquist Åstrand
15d0393660
Add some more comments about how this works.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19126 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-26 16:56:54 +00:00
Love Hörnquist Åstrand
d27456dd83
(hx509_select): new function.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19122 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-26 15:53:12 +00:00
Love Hörnquist Åstrand
85ee798833
Sprinkle context and error strings.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19111 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-25 12:31:34 +00:00
Love Hörnquist Åstrand
a6ad00f6e0
return less EINVAL
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18864 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-24 13:57:59 +00:00
Love Hörnquist Åstrand
f58f609484
Sprinkle more hx509_context so we can return propper errors.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18861 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-24 13:34:21 +00:00
Love Hörnquist Åstrand
35e6948538
(_hx509_private_key2SPKI): indent
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18798 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-21 22:43:34 +00:00
Love Hörnquist Åstrand
24e79ac572
Try to not leak memory.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18788 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-21 20:32:41 +00:00
Love Hörnquist Åstrand
1860dc7db2
(hx509_crypto_destroy): free oid.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18785 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-21 20:04:06 +00:00
Love Hörnquist Åstrand
96204e40a8
prefix der primitives with der_
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18453 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-14 09:42:43 +00:00
Love Hörnquist Åstrand
f62a5620c6
check that there are no extra bytes in the checksum and that the
...
parameters are NULL or the NULL-type. All to avoid having excess data
that can be used to fake the signature.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18031 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-05 21:38:44 +00:00
Love Hörnquist Åstrand
9537609087
Start to hang the private key operations of the private key,
...
pass hx509_context to create_checksum.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17964 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-04 07:20:34 +00:00
Love Hörnquist Åstrand
64bc25c77b
(hx509_crypto_encrypt): free correctly in error path. From Andrew Bartlett.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17520 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-08 20:34:48 +00:00
Love Hörnquist Åstrand
3de0915340
If RAND_bytes fails, then we will attempt to double-free crypt->key.data.
...
From Andrew Bartlett.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17518 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-08 16:46:31 +00:00
Love Hörnquist Åstrand
a6fdb2b939
Sprinkle setting error strings.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17408 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-02 10:40:53 +00:00
Love Hörnquist Åstrand
2ecd5af5e2
Add names to cipher types.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17160 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-22 07:23:28 +00:00
Love Hörnquist Åstrand
f574f03d70
(oid_private_rc2_40): simply
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17148 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 21:18:14 +00:00
Love Hörnquist Åstrand
cfdc3e297c
Use oid from asn1 generator.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17147 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 21:14:46 +00:00
Love Hörnquist Åstrand
6bb4cc8a23
Handle rsa private keys better.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17118 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 11:23:16 +00:00
Love Hörnquist Åstrand
fa1990b911
Use the right length for the sha256 checksums.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17105 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-20 16:47:09 +00:00
Love Hörnquist Åstrand
23a182bbe3
Fix breakage from sha256 code.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17086 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-15 15:38:51 +00:00
Love Hörnquist Åstrand
c5796dfb7f
Add SHA256 support, and symbols for the other new SHA-2 types.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17082 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-15 12:54:10 +00:00
Love Hörnquist Åstrand
be73b86680
Break out the parameter handling code for encrypting data to handle RC2.
...
Needed for Windows 2k pk-init support.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17067 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-14 20:58:31 +00:00
Love Hörnquist Åstrand
66fce528ed
Avoid crashing on bad input.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16980 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-03 07:45:48 +00:00
Love Hörnquist Åstrand
10dbe873a1
make rsa_private_key2SPKI static.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16975 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-03 05:28:26 +00:00
Love Hörnquist Åstrand
6a6823b916
Add _hx509_private_key2SPKI and support functions (only support RSA for now).
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16968 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-03 05:10:34 +00:00
Love Hörnquist Åstrand
ea0cf892aa
(_hx509_verify_signature_bitstring): new function, commonly use when
...
checking certificates
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16885 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-31 22:05:37 +00:00
Love Hörnquist Åstrand
654d1bcf68
(_hx509_pbe_decrypt): try all passwords, not just the first one.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16852 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-28 13:12:09 +00:00
Love Hörnquist Åstrand
2832b00b67
Manual page claims RSA_public_decrypt will return -1 on error, lets check for that
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16847 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-28 03:46:54 +00:00
Love Hörnquist Åstrand
7f803fd58d
(_hx509_pbe_decrypt): also try the empty password
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16841 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-27 22:10:36 +00:00
Love Hörnquist Åstrand
381c1b5a04
Add REQUIRE_SIGNER
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16837 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-27 21:34:58 +00:00
Love Hörnquist Åstrand
c4c31576fe
(_hx509_private_key_assign_key_file): ask for password if nothing matches.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16813 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-26 23:54:18 +00:00
Love Hörnquist Åstrand
baf806b355
(dsa_verify_signature): if test if malloc failed
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16738 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-02-14 10:44:52 +00:00
Love Hörnquist Åstrand
163c6cb7b5
delete crypto_headers.h, use global file instead
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16560 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-13 14:02:49 +00:00
Love Hörnquist Åstrand
41ce53a16e
(PBE_string2key): libdes now supports PKCS12_key_gen
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16544 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-13 08:44:57 +00:00