You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/06/19 08:33:10 UTC
[trafficserver] 01/04: Chaange type of packet number length
parameters
This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 499aa73bab749ba1007e4849b1b2b789ebda5138
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Jun 19 17:21:16 2018 +0900
Chaange type of packet number length parameters
---
iocore/net/quic/QUICHandshakeProtocol.h | 8 ++++----
iocore/net/quic/QUICTLS.cc | 4 ++--
iocore/net/quic/QUICTLS.h | 8 ++++----
iocore/net/quic/QUICTLS_openssl.cc | 4 ++--
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/iocore/net/quic/QUICHandshakeProtocol.h b/iocore/net/quic/QUICHandshakeProtocol.h
index 145b7b7..0701c4d 100644
--- a/iocore/net/quic/QUICHandshakeProtocol.h
+++ b/iocore/net/quic/QUICHandshakeProtocol.h
@@ -59,10 +59,10 @@ public:
uint64_t pkt_num, const uint8_t *ad, size_t ad_len, QUICKeyPhase phase) const = 0;
virtual bool decrypt(uint8_t *plain, size_t &plain_len, size_t max_plain_len, const uint8_t *cipher, size_t cipher_len,
uint64_t pkt_num, const uint8_t *ad, size_t ad_len, QUICKeyPhase phase) const = 0;
- virtual bool encrypt_pn(uint8_t *protected_pn, size_t &protected_pn_len, const uint8_t *unprotected_pn, size_t unprotected_pn_len,
- const uint8_t *sample, QUICKeyPhase phase) const = 0;
- virtual bool decrypt_pn(uint8_t *unprotected_pn, size_t &unprotected_pn_len, const uint8_t *protected_pn, size_t protected_pn_len,
- const uint8_t *sample, QUICKeyPhase phase) const = 0;
+ virtual bool encrypt_pn(uint8_t *protected_pn, uint8_t &protected_pn_len, const uint8_t *unprotected_pn,
+ uint8_t unprotected_pn_len, const uint8_t *sample, QUICKeyPhase phase) const = 0;
+ virtual bool decrypt_pn(uint8_t *unprotected_pn, uint8_t &unprotected_pn_len, const uint8_t *protected_pn,
+ uint8_t protected_pn_len, const uint8_t *sample, QUICKeyPhase phase) const = 0;
virtual QUICHandshakeMsgType msg_type() const;
protected:
diff --git a/iocore/net/quic/QUICTLS.cc b/iocore/net/quic/QUICTLS.cc
index 4ac7d56..09250c3 100644
--- a/iocore/net/quic/QUICTLS.cc
+++ b/iocore/net/quic/QUICTLS.cc
@@ -342,7 +342,7 @@ QUICTLS::decrypt(uint8_t *plain, size_t &plain_len, size_t max_plain_len, const
}
bool
-QUICTLS::encrypt_pn(uint8_t *protected_pn, size_t &protected_pn_len, const uint8_t *unprotected_pn, size_t unprotected_pn_len,
+QUICTLS::encrypt_pn(uint8_t *protected_pn, uint8_t &protected_pn_len, const uint8_t *unprotected_pn, uint8_t unprotected_pn_len,
const uint8_t *sample, QUICKeyPhase phase) const
{
const KeyMaterial *km = this->_get_km(phase, true);
@@ -360,7 +360,7 @@ QUICTLS::encrypt_pn(uint8_t *protected_pn, size_t &protected_pn_len, const uint8
}
bool
-QUICTLS::decrypt_pn(uint8_t *unprotected_pn, size_t &unprotected_pn_len, const uint8_t *protected_pn, size_t protected_pn_len,
+QUICTLS::decrypt_pn(uint8_t *unprotected_pn, uint8_t &unprotected_pn_len, const uint8_t *protected_pn, uint8_t protected_pn_len,
const uint8_t *sample, QUICKeyPhase phase) const
{
const KeyMaterial *km = this->_get_km(phase, false);
diff --git a/iocore/net/quic/QUICTLS.h b/iocore/net/quic/QUICTLS.h
index 86d4db7..ec2c9df 100644
--- a/iocore/net/quic/QUICTLS.h
+++ b/iocore/net/quic/QUICTLS.h
@@ -53,9 +53,9 @@ public:
const uint8_t *ad, size_t ad_len, QUICKeyPhase phase) const override;
bool decrypt(uint8_t *plain, size_t &plain_len, size_t max_plain_len, const uint8_t *cipher, size_t cipher_len, uint64_t pkt_num,
const uint8_t *ad, size_t ad_len, QUICKeyPhase phase) const override;
- bool encrypt_pn(uint8_t *protected_pn, size_t &protected_pn_len, const uint8_t *unprotected_pn, size_t unprotected_pn_len,
+ bool encrypt_pn(uint8_t *protected_pn, uint8_t &protected_pn_len, const uint8_t *unprotected_pn, uint8_t unprotected_pn_len,
const uint8_t *sample, QUICKeyPhase phase) const override;
- bool decrypt_pn(uint8_t *unprotected_pn, size_t &unprotected_pn_len, const uint8_t *protected_pn, size_t protected_pn_lenn,
+ bool decrypt_pn(uint8_t *unprotected_pn, uint8_t &unprotected_pn_len, const uint8_t *protected_pn, uint8_t protected_pn_len,
const uint8_t *sample, QUICKeyPhase phase) const override;
// FIXME SSL handle should not be exported
@@ -75,9 +75,9 @@ private:
size_t tag_len) const;
bool _decrypt(uint8_t *plain, size_t &plain_len, size_t max_plain_len, const uint8_t *cipher, size_t cipher_len, uint64_t pkt_num,
const uint8_t *ad, size_t ad_len, const KeyMaterial &km, const QUIC_EVP_CIPHER *aead, size_t tag_len) const;
- bool _encrypt_pn(uint8_t *protected_pn, size_t &protected_pn_len, const uint8_t *unprotected_pn, size_t unprotected_pn_len,
+ bool _encrypt_pn(uint8_t *protected_pn, uint8_t &protected_pn_len, const uint8_t *unprotected_pn, uint8_t unprotected_pn_len,
const uint8_t *sample, const KeyMaterial &km, const QUIC_EVP_CIPHER *aead) const;
- bool _decrypt_pn(uint8_t *unprotected_pn, size_t &unprotected_pn_len, const uint8_t *protected_pn, size_t protected_pn_len,
+ bool _decrypt_pn(uint8_t *unprotected_pn, uint8_t &unprotected_pn_len, const uint8_t *protected_pn, uint8_t protected_pn_len,
const uint8_t *sample, const KeyMaterial &km, const QUIC_EVP_CIPHER *aead) const;
SSL *_ssl = nullptr;
QUICPacketProtection *_client_pp = nullptr;
diff --git a/iocore/net/quic/QUICTLS_openssl.cc b/iocore/net/quic/QUICTLS_openssl.cc
index 0aae1d5..a1030b0 100644
--- a/iocore/net/quic/QUICTLS_openssl.cc
+++ b/iocore/net/quic/QUICTLS_openssl.cc
@@ -222,7 +222,7 @@ QUICTLS::_decrypt(uint8_t *plain, size_t &plain_len, size_t max_plain_len, const
}
bool
-QUICTLS::_encrypt_pn(uint8_t *protected_pn, size_t &protected_pn_len, const uint8_t *unprotected_pn, size_t unprotected_pn_len,
+QUICTLS::_encrypt_pn(uint8_t *protected_pn, uint8_t &protected_pn_len, const uint8_t *unprotected_pn, uint8_t unprotected_pn_len,
const uint8_t *sample, const KeyMaterial &km, const EVP_CIPHER *aead) const
{
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
@@ -245,7 +245,7 @@ QUICTLS::_encrypt_pn(uint8_t *protected_pn, size_t &protected_pn_len, const uint
}
bool
-QUICTLS::_decrypt_pn(uint8_t *unprotected_pn, size_t &unprotected_pn_len, const uint8_t *protected_pn, size_t protected_pn_len,
+QUICTLS::_decrypt_pn(uint8_t *unprotected_pn, uint8_t &unprotected_pn_len, const uint8_t *protected_pn, uint8_t protected_pn_len,
const uint8_t *sample, const KeyMaterial &km, const EVP_CIPHER *aead) const
{
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();