diff options
author | Martin Willi <martin@strongswan.org> | 2009-09-11 15:35:10 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-09-11 15:39:35 +0200 |
commit | 3b878dae7e7bb00f8d886426dc4f75bf45b8113f (patch) | |
tree | be56294135f3b29788390b4695de1c973b454302 /src/libstrongswan/plugins/agent/agent_private_key.c | |
parent | 3a7bd9bd49685c96313038436b770115651b7caa (diff) | |
download | strongswan-3b878dae7e7bb00f8d886426dc4f75bf45b8113f.tar.bz2 strongswan-3b878dae7e7bb00f8d886426dc4f75bf45b8113f.tar.xz |
Removed chunk_from_buf() in favor of a simpler chunk_from_chars() macro
Diffstat (limited to 'src/libstrongswan/plugins/agent/agent_private_key.c')
-rw-r--r-- | src/libstrongswan/plugins/agent/agent_private_key.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstrongswan/plugins/agent/agent_private_key.c b/src/libstrongswan/plugins/agent/agent_private_key.c index 1c48d706c..2bc6dea34 100644 --- a/src/libstrongswan/plugins/agent/agent_private_key.c +++ b/src/libstrongswan/plugins/agent/agent_private_key.c @@ -161,7 +161,7 @@ static bool read_key(private_agent_private_key_t *this, public_key_t *pubkey) { int len, count; char buf[2048]; - chunk_t blob = chunk_from_buf(buf), key, type, n; + chunk_t blob, key, type, n; len = htonl(1); buf[0] = SSH_AGENT_ID_REQUEST; @@ -172,6 +172,7 @@ static bool read_key(private_agent_private_key_t *this, public_key_t *pubkey) return FALSE; } + blob = chunk_create(buf, sizeof(buf)); blob.len = read(this->socket, blob.ptr, blob.len); if (blob.len < sizeof(u_int32_t) + sizeof(u_char) || @@ -226,7 +227,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme, { u_int32_t len, flags; char buf[2048]; - chunk_t blob = chunk_from_buf(buf); + chunk_t blob; if (scheme != SIGN_RSA_EMSA_PKCS1_SHA1) { @@ -267,6 +268,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme, return FALSE; } + blob = chunk_create(buf, sizeof(buf)); blob.len = read(this->socket, blob.ptr, blob.len); if (blob.len < sizeof(u_int32_t) + sizeof(u_char) || read_uint32(&blob) != blob.len || |