diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-05-30 14:46:24 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-06-11 17:33:28 +0200 |
commit | cc55783f36bc3d99c7f765ae9ca25cb49bce7844 (patch) | |
tree | 9bfd55531d6842922c8f806e386e627537d44fa0 /src/libstrongswan/crypto/hashers/hasher.h | |
parent | 82e526ce81db15f92b81cd4ac925d740f3b4d753 (diff) | |
download | strongswan-cc55783f36bc3d99c7f765ae9ca25cb49bce7844.tar.bz2 strongswan-cc55783f36bc3d99c7f765ae9ca25cb49bce7844.tar.xz |
Added function to convert integrity algorithms to hash algorithms (if based on one).
Diffstat (limited to 'src/libstrongswan/crypto/hashers/hasher.h')
-rw-r--r-- | src/libstrongswan/crypto/hashers/hasher.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libstrongswan/crypto/hashers/hasher.h b/src/libstrongswan/crypto/hashers/hasher.h index 9fa043c7e..4d0d66fcf 100644 --- a/src/libstrongswan/crypto/hashers/hasher.h +++ b/src/libstrongswan/crypto/hashers/hasher.h @@ -1,7 +1,7 @@ /* - * Copyright (C) 2005 Jan Hutter + * Copyright (C) 2012 Tobias Brunner * Copyright (C) 2005-2006 Martin Willi - * + * Copyright (C) 2005 Jan Hutter * Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ typedef enum hash_algorithm_t hash_algorithm_t; typedef struct hasher_t hasher_t; #include <library.h> +#include <crypto/signers/signer.h> #include <credentials/keys/public_key.h> /** @@ -119,6 +120,14 @@ struct hasher_t { hash_algorithm_t hasher_algorithm_from_oid(int oid); /** + * Conversion of integrity algorithm to hash algorithm (if based on one). + * + * @param integrity integrity algorithm + * @return hash algorithm, HASH_UNKNOWN if not based on a hash + */ +hash_algorithm_t hasher_algorithm_from_integrity(integrity_algorithm_t integrity); + +/** * Conversion of hash algorithm into ASN.1 OID. * * @param alg hash algorithm |