diff options
author | Andreas Steffen <andreas@strongswan.org> | 2009-07-06 08:47:18 +0200 |
---|---|---|
committer | Andreas Steffen <andreas@strongswan.org> | 2009-07-06 08:47:18 +0200 |
commit | 21863d63617371e7bc5da8033eea99158471e93a (patch) | |
tree | 19338ec293c6561509c3b9fc9fa01065f07959b5 /src/libstrongswan/plugins/openssl/openssl_util.c | |
parent | 887ed734d0d17079ff5772dc3c5f505f75764c1b (diff) | |
download | strongswan-21863d63617371e7bc5da8033eea99158471e93a.tar.bz2 strongswan-21863d63617371e7bc5da8033eea99158471e93a.tar.xz |
ecp_x_coordinate only option allows ECP interoperability with MS Windows
Diffstat (limited to 'src/libstrongswan/plugins/openssl/openssl_util.c')
-rw-r--r-- | src/libstrongswan/plugins/openssl/openssl_util.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_util.c b/src/libstrongswan/plugins/openssl/openssl_util.c index bb0c296e1..c8c453f64 100644 --- a/src/libstrongswan/plugins/openssl/openssl_util.c +++ b/src/libstrongswan/plugins/openssl/openssl_util.c @@ -71,21 +71,26 @@ bool openssl_bn_cat(int len, BIGNUM *a, BIGNUM *b, chunk_t *chunk) { int offset; - chunk->len = len * 2; + chunk->len = len + (b ? len : 0); chunk->ptr = malloc(chunk->len); memset(chunk->ptr, 0, chunk->len); + /* convert a */ offset = len - BN_num_bytes(a); if (!BN_bn2bin(a, chunk->ptr + offset)) { goto error; } - offset = len - BN_num_bytes(b); - if (!BN_bn2bin(b, chunk->ptr + len + offset)) + /* optionally convert and concatenate b */ + if (b) { - goto error; - } + offset = len - BN_num_bytes(b); + if (!BN_bn2bin(b, chunk->ptr + len + offset)) + { + goto error; + } + } return TRUE; error: |