diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-08-23 19:28:09 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-08-23 19:28:09 +0200 |
commit | 5e53eebd5fab5559f54f5b25b2b11116987cdb1d (patch) | |
tree | 70b7a4fb78c52d1109e9b99d4053f3274a0acbfe /lib/tls-sig.c | |
parent | f84d8c0d536a1b6a160ddceadf7fade8d7b2edaa (diff) | |
download | gnutls-5e53eebd5fab5559f54f5b25b2b11116987cdb1d.tar.gz |
Moved pk_* functions to pk.c
Diffstat (limited to 'lib/tls-sig.c')
-rw-r--r-- | lib/tls-sig.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/lib/tls-sig.c b/lib/tls-sig.c index 8706ac598b..f51966aa3e 100644 --- a/lib/tls-sig.c +++ b/lib/tls-sig.c @@ -681,70 +681,3 @@ _gnutls_handshake_sign_crt_vrfy(gnutls_session_t session, return ret; } -int -pk_hash_data(gnutls_pk_algorithm_t pk, const mac_entry_st * hash, - gnutls_pk_params_st * params, - const gnutls_datum_t * data, gnutls_datum_t * digest) -{ - int ret; - - digest->size = _gnutls_hash_get_algo_len(hash); - digest->data = gnutls_malloc(digest->size); - if (digest->data == NULL) { - gnutls_assert(); - return GNUTLS_E_MEMORY_ERROR; - } - - ret = - _gnutls_hash_fast((gnutls_digest_algorithm_t)hash->id, data->data, data->size, - digest->data); - if (ret < 0) { - gnutls_assert(); - goto cleanup; - } - - return 0; - - cleanup: - gnutls_free(digest->data); - return ret; -} - - -/* - * This function will do RSA PKCS #1 1.5 encoding - * on the given digest. The given digest must be allocated - * and will be freed if replacement is required. - */ -int -pk_prepare_hash(gnutls_pk_algorithm_t pk, - const mac_entry_st * hash, gnutls_datum_t * digest) -{ - int ret; - gnutls_datum_t old_digest = { digest->data, digest->size }; - - switch (pk) { - case GNUTLS_PK_RSA: - if (unlikely(hash == NULL)) - return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); - /* Encode the digest as a DigestInfo - */ - if ((ret = - encode_ber_digest_info(hash, &old_digest, - digest)) != 0) { - gnutls_assert(); - return ret; - } - - _gnutls_free_datum(&old_digest); - break; - case GNUTLS_PK_DSA: - case GNUTLS_PK_EC: - break; - default: - gnutls_assert(); - return GNUTLS_E_UNIMPLEMENTED_FEATURE; - } - - return 0; -} |