aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtls/tls_protection.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-08-12 23:58:29 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-08-12 23:58:54 +0200
commitb62e9a30ce6214aee03a713a9b4d602ad1281c82 (patch)
tree6b295908b6b8b96e4cbbcbbef2f1828eb1d7dfd3 /src/libtls/tls_protection.c
parent4412ee86c57366ee9af6643e7058e2cf12110007 (diff)
downloadstrongswan-b62e9a30ce6214aee03a713a9b4d602ad1281c82.tar.bz2
strongswan-b62e9a30ce6214aee03a713a9b4d602ad1281c82.tar.xz
fixed sequence numbering and iv of TLS protection layer
Diffstat (limited to 'src/libtls/tls_protection.c')
-rw-r--r--src/libtls/tls_protection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libtls/tls_protection.c b/src/libtls/tls_protection.c
index 5ea0a8312..51a480858 100644
--- a/src/libtls/tls_protection.c
+++ b/src/libtls/tls_protection.c
@@ -241,8 +241,8 @@ METHOD(tls_protection_t, build, status_t,
if (this->iv_out.len)
{ /* next record IV is last ciphertext block of this record */
- memcpy(this->iv_out.ptr, data->ptr - this->iv_out.len,
- this->iv_out.len);
+ memcpy(this->iv_out.ptr, data->ptr + data->len -
+ this->iv_out.len, this->iv_out.len);
}
else
{ /* prepend IV */
@@ -254,8 +254,8 @@ METHOD(tls_protection_t, build, status_t,
*data = chunk_cat("mm", *data, mac);
}
}
+ this->seq_out++;
}
- this->seq_out++;
return status;
}