Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 61 additions & 13 deletions wolfSSL/src-ja/appendix04.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

## アーキテクチャ

組み込み向けSSL/TLSライブラリであるwolfSSL(旧称:Cyassl)は、SSL 3.0、TLS 1.0、TLS 1.1、TLS 1.2、TLS 1.3プロトコルを実装しています。
組み込み向けSSL/TLSライブラリであるwolfSSL(旧称:CyaSSL)は、SSL 3.0、TLS 1.0、TLS 1.1、TLS 1.2、TLS 1.3プロトコルに加えて、DTLS 1.0、DTLS 1.2、DTLS 1.3を実装しています。
TLS 1.3は、標準化されている最も安全な最新バージョンです。
SSL 2.0は数年間不安定であることから、サポートしていません。

wolfSSLのTLSプロトコルは、[RFC 5246](https://tex2e.github.io/rfc-translater/html/rfc5246) で定義されている通りに実装されています。
TLSには、メッセージ層とハンドシェーク層の2つのレコード層プロトコルが存在します。
SSL 3.0(RFC 7568)、TLS 1.0およびTLS 1.1(RFC 8996)は非推奨となっているため、wolfSSLはデフォルトではこれらをビルドに含めません。
これらは`--enable-sslv3`、`--enable-tlsv10`、`--enable-oldtls`で明示的に有効にした場合にのみコンパイルされます。
SSL 2.0は長年にわたり安全でないとされていることから、サポートしていません。

wolfSSLは、TLS 1.2を[RFC 5246](https://tex2e.github.io/rfc-translater/html/rfc5246)、TLS 1.3を[RFC 8446](https://tex2e.github.io/rfc-translater/html/rfc8446)で定義されている通りに実装しています。
DTLS 1.2は[RFC 6347](https://tools.ietf.org/html/rfc6347)に、DTLS 1.3は[RFC 9147](https://tools.ietf.org/html/rfc9147)に準拠しています。
TLSは階層化されたプロトコルです。
下位層はレコードプロトコルで、上位層のプロトコルのデータを断片化し、保護(暗号化と認証)して送信します。
上位層のプロトコルには、ハンドシェイクプロトコル、アラートプロトコル、ChangeCipherSpecプロトコル(TLS 1.2以前のみ)、およびアプリケーションデータがあります。
ハンドシェイクメッセージは、共通の暗号スイートのネゴシエーション、シークレットの作成、および安全な接続の有効化に使用されます。
メッセージレイヤーはハンドシェイクレイヤーをカプセル化すると同時に、アラート処理とアプリケーションデータ転送もサポートします。
アラートメッセージは、エラーや接続の終了を通知します。

SSLプロトコルが既存のプロトコルにどのように適合するかを、**図1**に示します。
SSLは、OSIモデルのトランスポート層とアプリケーション層の間に位置し、多くのプロトコル (TCP/IP、Bluetoothなど) がトランスポートメディアとして機能します。
Expand All @@ -24,13 +29,46 @@ SSLハンドシェイクプロセスの簡略を以下の**図2**に示します

![ハンドシェイク](sslhandshake.png)

**図2**は、TLS 1.2以前のバージョンにおけるフルハンドシェイクを示しています。
実際のメッセージ順序では、証明書を要求されたクライアントは、ClientKeyExchangeメッセージの前にCertificateメッセージを送信し、ClientKeyExchangeメッセージの後にCertificateVerifyメッセージを送信します。

### TLS 1.3ハンドシェイク

TLS 1.3では、これとは異なる、より短いハンドシェイクを使用します。
鍵交換はHelloメッセージ(`key_share`拡張)の中で行われるため、フルハンドシェイクでは、クライアントがアプリケーションデータを送信できるようになるまでに1往復(1ラウンドトリップ)しか必要としません。
ServerKeyExchange、ServerHelloDone、ClientKeyExchangeメッセージは存在せず、ChangeCipherSpecはミドルボックス互換モードでダミーメッセージとして送信されるのみです。
また、サーバーがServerHelloの後に送信するメッセージはすべて暗号化されます。

```text
Client Server

ClientHello (key_share, supported_versions)
-------->
ServerHello (key_share)
{EncryptedExtensions}
{CertificateRequest} *
{Certificate}
{CertificateVerify}
{Finished}
<--------
{Certificate} *
{CertificateVerify} *
{Finished}
-------->
[Application Data] <-------> [Application Data]

* sent only when the server requests client authentication
{} encrypted with the handshake traffic keys
[] encrypted with the application traffic keys
```

## SSL/TLSにおける、バージョンごとの違い

SSL (Secure Sockets Layer) と TLS (Transport Security Layer) はどちらも、ネットワーク上で安全な通信を提供する暗号化プロトコルです。
SSL (Secure Sockets Layer) と TLS (Transport Layer Security) はどちらも、ネットワーク上で安全な通信を提供する暗号化プロトコルです。
これら2つのプロトコルは、今日、WebブラウジングからEメール、インスタントメッセージング、VoIPに至るまで、さまざまなアプリケーションで広く使用されています。
SSLとTLS、そしてそれぞれに含まれる各バージョン間にはいくつかの違いがあります。

以下に、SSL および TLS プロトコルの各バージョンについての解説と主な相違点を示します。
以下に、SSL および TLS プロトコルの各バージョンについての解説と主な相違点を示します。
各プロトコルの具体的な詳細については、記載されているRFC仕様を参照してください。

### SSL 3.0
Expand Down Expand Up @@ -79,23 +117,33 @@ TLS 1.1 をベースとして、いくつかの改善が行われました。
* クライアントとサーバーが受け入れるハッシュおよび署名アルゴリズムの組み合わせが整理されました。
* 追加のデータモードを使用した、認証された暗号化のためのサポートが追加されました。
* TLS拡張機能の定義とAES暗号スイートがマージされました。
* EncryptedPremasterSecretバージョン番号が厳しくチェックされるようになりました。
* EncryptedPreMasterSecretバージョン番号が厳しくチェックされるようになりました。
* 多くの要件が厳しくなりました。
* `Verify_data`の長さは暗号スイートに依存します
* Bleichenbacher/Dlima 攻撃防御の説明が簡潔になりました。
* `Verify_data`の長さは暗号スイートに依存します。
* Bleichenbacher/Klima 攻撃防御の説明が簡潔になりました。

### TLS 1.3

このプロトコルは、2018年8月に[RFC 8446](https://tex2e.github.io/rfc-translater/html/rfc8446)で定義されました。
主に、セキュリティ性能とスピードが向上しています。
主な違いは次のとおりです。

* サポートされている対称アルゴリズムのリストは、すべての従来のアルゴリズムから整理されました。残りのアルゴリズムはすべて、認証タグ付き暗号(AEAD) アルゴリズムを使用します。
* サポートされている対称アルゴリズムのリストから、従来のアルゴリズムがすべて削除されました。残りのアルゴリズムはすべて、認証タグ付き暗号(AEAD) アルゴリズムを使用します。
* ゼロRTT (0-RTT) モードが追加され、一部のセキュリティ属性を犠牲にすることで、一部のアプリケーションデータのための接続時のラウンドトリップが削減されました。
* `ServerHello`の後のすべてのハンドシェイクメッセージが暗号化されるようになりました。
* HMACベースの抽出および拡張鍵導出機能(HKDF)がプリミティブとして使用されているため、鍵導出機能が再設計されました。
* ハンドシェイクステートマシンが再構築され、一貫性が向上し、余分なメッセージが削除されました。
* ECCは基本仕様になり、新しい署名アルゴリズムが含まれるようになりました。各曲線の単一のポイント形式を支持して、ポイント形式のネゴシエーションを削除しました。
* 圧縮、カスタムDHEグループ、およびDSAが削除されました、RSAパディングはPSSを使用するようになりました。
* 圧縮、カスタムDHEグループ、およびDSAが削除されました。RSA署名はPSSパディングを使用するようになりました。
* 静的RSAおよび静的Diffie-Hellmanの暗号スイートが削除され、公開鍵ベースの鍵交換メカニズムはすべて前方秘匿性を提供するようになりました。
* TLS 1.2 バージョンネゴシエーション検証メカニズムは廃止され、拡張機能のバージョンリストが採用されました。
* サーバー側の状態の有無にかかわらず、セッションの再開と、TLSの以前のバージョンのPSKベースの暗号スイートは、単一の新しいPSK交換に置き換えられました。

### DTLS

DTLS(Datagram Transport Layer Security)は、TLSをUDPなどのデータグラムトランスポートに適応させたプロトコルです。
DTLSでは、明示的なレコードシーケンス番号とエポック、失われたハンドシェイクメッセージの再送信、およびサーバーをサービス拒否攻撃から保護するクッキー交換が追加されています。
DTLS 1.0(RFC 4347)はTLS 1.1を、DTLS 1.2(RFC 6347)はTLS 1.2を、DTLS 1.3(RFC 9147)はTLS 1.3をベースにしており、DTLS 1.1は存在しません。
wolfSSLでは、DTLSはデフォルトで無効です。
DTLS 1.2には`--enable-dtls`を、DTLS 1.3には`--enable-dtls13`を使用してください。
DTLS 1.0には`--enable-oldtls`も必要です。
81 changes: 70 additions & 11 deletions wolfSSL/src-ja/appendix05.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,106 @@

## プロトコル

* SSL v3.0 - [IETF Draft](https://tools.ietf.org/id/draft-ietf-tls-ssl-version3-00.txt)
* SSL v3.0 - [RFC6101](https://datatracker.ietf.org/doc/html/rfc6101)(ステータスはHistoric。[RFC7568](https://datatracker.ietf.org/doc/html/rfc7568)により非推奨化)
* TLS v1.0 - [RFC2246](https://www.ietf.org/rfc/rfc2246.txt)
* TLS v1.1 - [RFC4346](https://www.ietf.org/rfc/rfc4346.txt)
* TLS 1.0およびTLS 1.1の非推奨化 - [RFC8996](https://datatracker.ietf.org/doc/html/rfc8996)
* TLS v1.2 - [RFC5246](https://www.ietf.org/rfc/rfc5246.txt)
* TLS v1.3 - [RFC8446](https://www.ietf.org/rfc/rfc8446.txt)
* DTLS - [RFC9147](https://datatracker.ietf.org/doc/html/rfc9147)
* TLS v1.3 - [RFC8446](https://www.ietf.org/rfc/rfc8446.txt)、改訂版は[RFC9846](https://datatracker.ietf.org/doc/html/rfc9846)
* DTLS v1.0 - [RFC4347](https://datatracker.ietf.org/doc/html/rfc4347)
* DTLS v1.2 - [RFC6347](https://datatracker.ietf.org/doc/html/rfc6347)
* DTLS v1.3 - [RFC9147](https://datatracker.ietf.org/doc/html/rfc9147)
* TLSを使用したQUICの保護 - [RFC9001](https://datatracker.ietf.org/doc/html/rfc9001)
* TLSおよびDTLSの安全な使用に関する推奨事項(BCP 195) - [RFC9325](https://datatracker.ietf.org/doc/html/rfc9325)
* IPv4の概要 - [Wikipedia](https://en.wikipedia.org/wiki/IPv4)
* IPv6の概要 - [Wikipedia](https://en.wikipedia.org/wiki/IPv6)

## TLS拡張と暗号スイート

* TLS拡張機能(SNI、Maximum Fragment Length、Trusted CA Keys、Truncated HMAC、Certificate Status Request) - [RFC6066](https://datatracker.ietf.org/doc/html/rfc6066)
* Multiple Certificate Status Request(`status_request_v2`) - [RFC6961](https://datatracker.ietf.org/doc/html/rfc6961)
* Application-Layer Protocol Negotiation (ALPN) - [RFC7301](https://datatracker.ietf.org/doc/html/rfc7301)
* Renegotiation Indication - [RFC5746](https://datatracker.ietf.org/doc/html/rfc5746)
* セッションチケット - [RFC5077](https://datatracker.ietf.org/doc/html/rfc5077)
* Encrypt-then-MAC - [RFC7366](https://datatracker.ietf.org/doc/html/rfc7366)
* 拡張マスターシークレット(Extended Master Secret) - [RFC7627](https://datatracker.ietf.org/doc/html/rfc7627)
* TLS 1.2以前向けのECC暗号スイート - [RFC8422](https://datatracker.ietf.org/doc/html/rfc8422)([RFC4492](https://datatracker.ietf.org/doc/html/rfc4492)を廃止)
* 有限体Diffie-Hellman Ephemeral(FFDHE)グループ - [RFC7919](https://datatracker.ietf.org/doc/html/rfc7919)
* TLS 1.3向けのBrainpool曲線 - [RFC8734](https://datatracker.ietf.org/doc/html/rfc8734)
* Raw Public Keys - [RFC7250](https://datatracker.ietf.org/doc/html/rfc7250)
* AES-GCM暗号スイート - [RFC5288](https://datatracker.ietf.org/doc/html/rfc5288)
* AES-CCM暗号スイート - [RFC6655](https://datatracker.ietf.org/doc/html/rfc6655)
* ChaCha20-Poly1305暗号スイート - [RFC7905](https://datatracker.ietf.org/doc/html/rfc7905)
* ECDHE-PSK AEAD暗号スイート - [RFC8442](https://datatracker.ietf.org/doc/html/rfc8442)
* TLS 1.3向けの完全性保護のみの暗号スイート - [RFC9150](https://datatracker.ietf.org/doc/html/rfc9150)
* TLS 1.3向けのShangMi(SM)暗号スイート - [RFC8998](https://datatracker.ietf.org/doc/html/rfc8998)
* TLS 1.2およびDTLS 1.2におけるMD5およびSHA-1署名ハッシュの非推奨化 - [RFC9155](https://datatracker.ietf.org/doc/html/rfc9155)
* DTLS Connection ID - [RFC9146](https://datatracker.ietf.org/doc/html/rfc9146)
* DTLS-SRTP - [RFC5764](https://datatracker.ietf.org/doc/html/rfc5764)
* Encrypted Client Hello (ECH) - [RFC9849](https://datatracker.ietf.org/doc/html/rfc9849)
* 外部PSKを用いた証明書認証(`cert_with_extern_psk`) - [RFC9973](https://datatracker.ietf.org/doc/html/rfc9973)([RFC8773](https://datatracker.ietf.org/doc/html/rfc8773)を廃止)
* TLS 1.3向けのML-KEM - [draft-ietf-tls-mlkem](https://datatracker.ietf.org/doc/draft-ietf-tls-mlkem/)
* TLS 1.3向けのハイブリッドECDHE-ML-KEM - [draft-ietf-tls-ecdhe-mlkem](https://datatracker.ietf.org/doc/draft-ietf-tls-ecdhe-mlkem/)

## ストリーム暗号

* 概要 - [Wikipedia](https://en.wikipedia.org/wiki/Stream_cipher)
* RC4 / ARC4 - [IETF Draft](https://tools.ietf.org/id/draft-kaukonen-cipher-arcfour-03.txt) [Wikipedia](https://en.wikipedia.org/wiki/Rc4)
* ChaCha20およびPoly1305 - [RFC8439](https://datatracker.ietf.org/doc/html/rfc8439)

## ブロック暗号

* 概要 - [Wikipedia](https://en.wikipedia.org/wiki/Block_cipher)
* AES - [NIST Publication](https://csrc.nist.gov/publications/fips/fips197/fips-197.pdf) [Wikipedia](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)
* AES-GCM - [NIST Specification](https://csrc.nist.rip/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf)
* ブロック暗号の利用モード(ECB、CBC、CFB、OFB、CTR) - [NIST SP 800-38A](https://csrc.nist.gov/pubs/sp/800/38/a/final)
* AES-CMAC - [NIST SP 800-38B](https://csrc.nist.gov/pubs/sp/800/38/b/upd1/final)
* AES-CCM - [NIST SP 800-38C](https://csrc.nist.gov/pubs/sp/800/38/c/upd1/final)
* AES-GCM - [NIST SP 800-38D](https://csrc.nist.gov/pubs/sp/800/38/d/final)
* AES-SIV - [RFC5297](https://datatracker.ietf.org/doc/html/rfc5297)
* AES-GCM-SIV - [RFC8452](https://datatracker.ietf.org/doc/html/rfc8452)
* AESキーラップ - [RFC3394](https://datatracker.ietf.org/doc/html/rfc3394)、パディング付き - [RFC5649](https://datatracker.ietf.org/doc/html/rfc5649)
* AES-NI - [Intel Software Network](https://software.intel.com/en-us/articles/intel-advanced-encryption-standard-instructions-aes-ni/)
* DES/3DES - [NIST Publication](https://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf) [Wikipedia](https://en.wikipedia.org/wiki/Data_Encryption_Standard)

## ハッシュ

* SHA - [NIST FIPS180-1 Publication](https://www.itl.nist.gov/fipspubs/fip180-1.htm">https://www.itl.nist.gov/fipspubs/fip180-1.htm) [NIST FIPS180-2 Publication](https://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf) [Wikipedia](https://en.wikipedia.org/wiki/SHA_hash_functions)
* SHA-1およびSHA-2 - [NIST FIPS 180-4](https://csrc.nist.gov/pubs/fips/180-4/upd1/final) [Wikipedia](https://en.wikipedia.org/wiki/SHA_hash_functions)
* SHA-3およびSHAKE - [NIST FIPS 202](https://csrc.nist.gov/pubs/fips/202/final)
* MD4 - [RFC1320](https://tools.ietf.org/html/rfc1320)
* MD5 - [RFC1321](https://tools.ietf.org/html/rfc1321)
* RIPEMD-160 - [Specification document](https://homes.esat.kuleuven.be/~bosselae/ripemd160.html)
* HKDF - [RFC5869](https://datatracker.ietf.org/doc/html/rfc5869)

## 公開鍵暗号

* Diffie-Hellman - [Wikipedia](https://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange)
* RSA - [MIT Paper](https://people.csail.mit.edu/rivest/Rsapaper.pdf) [Wikipedia](https://en.wikipedia.org/wiki/RSA)
* DSA/DSS - [NIST FIPS186-3](https://csrc.nist.gov/publications/fips/fips186-3/fips_186-3.pdf)
* ECDSA - [Specification Document](https://www.cs.miami.edu/home/burt/learning/Csc609.142/ecdsa-cert.pdf)
* X.509 - [RFC3279](https://www.ietf.org/rfc/rfc3279.txt)
* RSA(PKCS#1 v2.2) - [RFC8017](https://datatracker.ietf.org/doc/html/rfc8017)
* デジタル署名標準(DSA、ECDSA、EdDSA) - [NIST FIPS 186-5](https://csrc.nist.gov/pubs/fips/186-5/final)。FIPS 186-5はFIPS 186-3および186-4に代わるもので、署名生成用としてDSAを承認していません。
* ECDSA - [NIST FIPS 186-5](https://csrc.nist.gov/pubs/fips/186-5/final) [SEC 1](https://www.secg.org/sec1-v2.pdf)、決定論的ECDSA - [RFC6979](https://datatracker.ietf.org/doc/html/rfc6979)
* EdDSA(Ed25519、Ed448) - [RFC8032](https://datatracker.ietf.org/doc/html/rfc8032)
* X25519およびX448 - [RFC7748](https://datatracker.ietf.org/doc/html/rfc7748)
* X.509 - [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)、アルゴリズム識別子 - [RFC3279](https://www.ietf.org/rfc/rfc3279.txt)
* ASN.1 - [Specification Document](https://luca.ntop.org/Teaching/Appunti/asn1.html) [Wikipedia](https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One)
* PSK - [RFC4279](https://tools.ietf.org/html/rfc4279)
* HPKE - [RFC9180](https://datatracker.ietf.org/doc/html/rfc9180)

## ポスト量子暗号

* ML-KEM - [NIST FIPS 203](https://csrc.nist.gov/pubs/fips/203/final)
* ML-DSA - [NIST FIPS 204](https://csrc.nist.gov/pubs/fips/204/final)
* SLH-DSA - [NIST FIPS 205](https://csrc.nist.gov/pubs/fips/205/final)
* LMS/HSS - [RFC8554](https://datatracker.ietf.org/doc/html/rfc8554)
* XMSS - [RFC8391](https://datatracker.ietf.org/doc/html/rfc8391)
* ステートフルハッシュベース署名(LMS、XMSS) - [NIST SP 800-208](https://csrc.nist.gov/pubs/sp/800/208/final)

## その他

* PKCS#5, PBKDF1, PBKDF2 - [RFC2898](https://tools.ietf.org/html/rfc2898)
* PKCS#8 - [RFC5208](https://tools.ietf.org/html/rfc5208)
* PKCS#12 - [Wikipedia](https://en.wikipedia.org/wiki/PKCS_12)
* PKCS#5, PBKDF1, PBKDF2 - [RFC8018](https://datatracker.ietf.org/doc/html/rfc8018)
* PKCS#7 / CMS - [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
* PKCS#8 - [RFC5958](https://datatracker.ietf.org/doc/html/rfc5958)
* PKCS#12 - [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292) [Wikipedia](https://en.wikipedia.org/wiki/PKCS_12)
* OCSP - [RFC6960](https://datatracker.ietf.org/doc/html/rfc6960)
* タイムスタンププロトコル(TSP) - [RFC3161](https://datatracker.ietf.org/doc/html/rfc3161)
* Argon2 - [RFC9106](https://datatracker.ietf.org/doc/html/rfc9106)
* Hash DRBG - [NIST SP 800-90A Rev. 1](https://csrc.nist.gov/pubs/sp/800/90/a/r1/final)
Loading
Loading