Add support for SCRAM-SHA-*-PLUS channel binding in PHP streams (e.g., tls-unique, tls-exporter)
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.1k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
Hello,
I'm the maintainer of the fabiang/sasl library, which implements various SASL mechanisms. Since many SASL mechanisms have been deprecated over the years due to security issues, I am interested in improving the security of the SCRAM-SHA-* SASL mechanisms.
The SCRAM-SHA-*-PLUS mechanisms offer better security through channel binding. The recommended channel binding types are:
- tls-unique for TLS <= 1.2
- tls-server-end-point
- tls-exporter for TLS >= 1.3
Currently, PHP lacks support for channel binding, as no API is exposed to access data from the underlying secure socket. Additionally, more and more server software is adding support for channel binding.
For example, Python:
- supports at least "tls-unique" through SSLSocket.get_channel_binding
- and has an open Pull Request for tls-exporter.
To enable this in PHP, a simple API to retrieve channel binding data from a stream context would be beneficial.
A potential function could:
- return data from OpenSSL's
SSL_get_peer_finishedwhen channel binding is set to "tls-unique" and TLS 1.2 is used, - use OpenSSL's
SSL_export_keying_materialwhen channel binding is set to "tls-exporter" and TLS <= 1.3 is used, - trigger a warning when "tls-unique" is used with TLS 1.3,
- and trigger an error if the stream or context is not a TLS connection.
(Note: "tls-exporter" should also be supported on TLS 1.2 connections.)
stream_crypto_channel_binding(resource $stream_or_context, string $channel_binding_type): string;
Making this function compatible with both streams and contexts should cover all use cases.
Thank you.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず PHP streams API と stream-context API を確認し、次に issue で指定されている OpenSSL インターフェースである SSL_get_peer_finished と SSL_export_keying_material を確認します。TLS ストリームまたはコンテキストについて、要求された channel-binding データを取得でき、指定された未サポート接続および TLS バージョンのケースを報告する文書化された API があれば完了です。payload では実装ファイルやテストを指定しません。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- api, security
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 32/100