Provide default AlgorithmIdentifier and use them.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20790 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-06-02 02:30:29 +00:00
parent 7cf2f2ac1a
commit 7fb311a15d

View File

@@ -1498,6 +1498,21 @@ const AlgorithmIdentifier *
hx509_crypto_aes256_cbc(void) hx509_crypto_aes256_cbc(void)
{ return &_hx509_crypto_aes256_cbc_data; } { return &_hx509_crypto_aes256_cbc_data; }
/*
*
*/
const AlgorithmIdentifier * _hx509_crypto_default_sig_alg =
&_hx509_signature_rsa_with_sha1_data;
const AlgorithmIdentifier * _hx509_crypto_default_digest_alg =
&_hx509_signature_sha1_data;
const AlgorithmIdentifier * _hx509_crypto_default_secret_alg =
&_hx509_crypto_aes128_cbc_data;
/*
*
*/
int int
_hx509_private_key_init(hx509_private_key *key, _hx509_private_key_init(hx509_private_key *key,
hx509_private_key_ops *ops, hx509_private_key_ops *ops,
@@ -2441,14 +2456,14 @@ hx509_crypto_select(const hx509_context context,
if (type == HX509_SELECT_DIGEST) { if (type == HX509_SELECT_DIGEST) {
bits = SIG_DIGEST; bits = SIG_DIGEST;
def = hx509_signature_sha256(); def = _hx509_crypto_default_digest_alg;
} else if (type == HX509_SELECT_PUBLIC_SIG) { } else if (type == HX509_SELECT_PUBLIC_SIG) {
bits = SIG_PUBLIC_SIG; bits = SIG_PUBLIC_SIG;
/* XXX depend on `source<63> and `peer<65> */ /* XXX depend on `source<63> and `peer<65> */
def = hx509_signature_rsa_with_sha256(); def = _hx509_crypto_default_sig_alg;
} else if (type == HX509_SELECT_SECRET_ENC) { } else if (type == HX509_SELECT_SECRET_ENC) {
bits = SIG_SECRET; bits = SIG_SECRET;
def = hx509_crypto_aes256_cbc(); def = _hx509_crypto_default_secret_alg;
} else { } else {
hx509_set_error_string(context, 0, EINVAL, hx509_set_error_string(context, 0, EINVAL,
"Unknown type %d of selection", type); "Unknown type %d of selection", type);