aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2009-09-18 17:26:30 +0800
committerChia-chi Yeh <chiachi@android.com>2009-09-18 17:41:19 +0800
commit4fa9505300a7249a6c216da88a3180a3a37ef078 (patch)
treee0a94999e0491bab162fe31b372f6d0b011a4d79 /src
parent051f86dfca525c160855397f7b6a4fb5ef8df2b5 (diff)
downloadipsec-tools-4fa9505300a7249a6c216da88a3180a3a37ef078.tar.gz
Diffstat (limited to 'src')
-rw-r--r--src/racoon/crypto_openssl.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/racoon/crypto_openssl.c b/src/racoon/crypto_openssl.c
index 0ec53cf..77d9ee9 100644
--- a/src/racoon/crypto_openssl.c
+++ b/src/racoon/crypto_openssl.c
@@ -440,16 +440,10 @@ eay_cmp_asn1dn(n1, n2)
static BIO *BIO_from_keystore(char *key)
{
BIO *bio = NULL;
- char *value;
- int size;
-
- value = keystore_get(key, &size);
- if (value) {
- bio = BIO_new(BIO_s_mem());
- if (bio) {
- BIO_write(bio, value, size);
- }
- free(value);
+ char value[KEYSTORE_MESSAGE_SIZE];
+ int length = keystore_get(key, value);
+ if (length != -1 && (bio = BIO_new(BIO_s_mem())) != NULL) {
+ BIO_write(bio, value, length);
}
return bio;
}