aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2016-06-27 12:07:50 +0200
committerTobias Brunner <tobias@strongswan.org>2016-06-29 11:09:37 +0200
commit375a5ed2400ba51918f01623ee0067acb2960d9d (patch)
tree0b1b2b20035c9a408d32deefc48c1dd36f848abe
parent6d5df086f77074d5e449f308dc6c33923177de54 (diff)
downloadstrongswan-375a5ed2400ba51918f01623ee0067acb2960d9d.tar.bz2
strongswan-375a5ed2400ba51918f01623ee0067acb2960d9d.tar.xz
openssl: Make some utilities take const BIGNUM pointers
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_util.c5
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_util.h5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_util.c b/src/libstrongswan/plugins/openssl/openssl_util.c
index a1d675f78..6580e1c7d 100644
--- a/src/libstrongswan/plugins/openssl/openssl_util.c
+++ b/src/libstrongswan/plugins/openssl/openssl_util.c
@@ -76,7 +76,8 @@ error:
/**
* Described in header.
*/
-bool openssl_bn_cat(int len, BIGNUM *a, BIGNUM *b, chunk_t *chunk)
+bool openssl_bn_cat(const int len, const BIGNUM *a, const BIGNUM *b,
+ chunk_t *chunk)
{
int offset;
@@ -133,7 +134,7 @@ bool openssl_bn_split(chunk_t chunk, BIGNUM *a, BIGNUM *b)
/**
* Described in header.
*/
-bool openssl_bn2chunk(BIGNUM *bn, chunk_t *chunk)
+bool openssl_bn2chunk(const BIGNUM *bn, chunk_t *chunk)
{
*chunk = chunk_alloc(BN_num_bytes(bn));
if (BN_bn2bin(bn, chunk->ptr) == chunk->len)
diff --git a/src/libstrongswan/plugins/openssl/openssl_util.h b/src/libstrongswan/plugins/openssl/openssl_util.h
index 264d47069..f4186e8c4 100644
--- a/src/libstrongswan/plugins/openssl/openssl_util.h
+++ b/src/libstrongswan/plugins/openssl/openssl_util.h
@@ -60,7 +60,8 @@ bool openssl_hash_chunk(int hash_type, chunk_t data, chunk_t *hash);
* @param chunk resulting chunk
* @return TRUE on success, FALSE otherwise
*/
-bool openssl_bn_cat(int len, BIGNUM *a, BIGNUM *b, chunk_t *chunk);
+bool openssl_bn_cat(const int len, const BIGNUM *a, const BIGNUM *b,
+ chunk_t *chunk);
/**
* Splits a chunk into two bignums of equal binary length.
@@ -80,7 +81,7 @@ bool openssl_bn_split(chunk_t chunk, BIGNUM *a, BIGNUM *b);
* @param chunk the chunk (data gets allocated)
* @return TRUE on success, FALSE otherwise
*/
-bool openssl_bn2chunk(BIGNUM *bn, chunk_t *chunk);
+bool openssl_bn2chunk(const BIGNUM *bn, chunk_t *chunk);
/**
* Allocate a chunk using the i2d function of a given object