Repository: cangSDARM/illustrate Branch: master Commit: ee3b5c8ce7a5 Files: 154 Total size: 638.1 KB Directory structure: gitextract_b3_7o8a6/ ├── .github/ │ └── workflows/ │ └── gh-pages.yml ├── .gitignore ├── .npmrc ├── .parcelrc ├── .prettierrc ├── .vscode/ │ └── settings.json ├── LICENSE ├── README.md ├── frombootstrap.css ├── index.html ├── package.json ├── print.js ├── printmode.css ├── public/ │ ├── .nojekyll │ ├── 404.html │ └── sitemap.xml └── src/ ├── App.jsx ├── DTLS/ │ ├── clientApplicationDataDatagram.json │ ├── clientApplicationKeysCalc.json │ ├── clientHandshakeFinishedDatagram.json │ ├── clientHandshakeKeysCalc.json │ ├── clientHelloDatagram.json │ ├── clientKeyExchangeGeneration.json │ ├── index.js │ ├── serverACKDatagram.json │ ├── serverAlertDatagram.json │ ├── serverApplicationDataDatagram.json │ ├── serverApplicationKeysCalc.json │ ├── serverCertVerifyDatagram.json │ ├── serverCertificateDatagram.json │ ├── serverEncryptedExtensionsDatagram.json │ ├── serverHandshakeFinishedDatagram.json │ ├── serverHandshakeKeysCalc.json │ ├── serverHelloDatagram.json │ └── serverKeyExchangeGeneration.json ├── Datagram/ │ ├── index.jsx │ └── style.module.css ├── Footer/ │ └── index.jsx ├── Header/ │ ├── index.jsx │ └── style.module.css ├── Intro/ │ ├── index.jsx │ └── style.module.css ├── QUIC/ │ ├── clientAck.json │ ├── clientApplicationKeysCalc.json │ ├── clientApplicationPacket1.json │ ├── clientApplicationPacket2.json │ ├── clientHandshake1.json │ ├── clientHandshake2.json │ ├── clientHandshakeKeysCalc.json │ ├── clientInitialKeysCalc.json │ ├── clientInitialPacket.json │ ├── clientKeyExchangeGeneration.json │ ├── clientTLSHandshakeFinished.json │ ├── index.js │ ├── padding.json │ ├── serverApplicationKeysCalc.json │ ├── serverApplicationPacket1.json │ ├── serverApplicationPacket2.json │ ├── serverHandshakeKeysCalc.json │ ├── serverHandshakePacket1.json │ ├── serverHandshakePacket2.json │ ├── serverHandshakePacket3.json │ ├── serverInitialKeysCalc.json │ ├── serverInitialPacket.json │ ├── serverKeyExchangeGeneration.json │ ├── serverTLSHandshakeFinished.json │ ├── tls-certificate.json │ ├── tls-certificateVerify.json │ ├── tls-clientHello.json │ ├── tls-encryptedExtensions.json │ └── tls-serverHello.json ├── RecOuter/ │ ├── Annotations/ │ │ ├── context.js │ │ ├── index.jsx │ │ └── style.module.css │ ├── CodeSample/ │ │ ├── index.jsx │ │ └── style.module.css │ ├── Math/ │ │ ├── index.jsx │ │ └── style.module.css │ ├── Table/ │ │ └── index.jsx │ ├── X25519/ │ │ ├── Calculator/ │ │ │ ├── PublicKeyMultiplier.jsx │ │ │ ├── SecretKeyMultiplier.jsx │ │ │ ├── YCoordinate.jsx │ │ │ ├── index.jsx │ │ │ ├── style.module.css │ │ │ └── utils.js │ │ ├── Flex/ │ │ │ ├── index.jsx │ │ │ └── style.module.css │ │ ├── QA/ │ │ │ ├── index.jsx │ │ │ └── style.module.css │ │ ├── curve.js │ │ ├── field.js │ │ └── index.js │ ├── index.jsx │ ├── style.module.css │ └── utils.jsx ├── TLS12/ │ ├── clientApplicationData.json │ ├── clientChangeCipherSpec.json │ ├── clientCloseNotify.json │ ├── clientEncryptionKeysGeneration.json │ ├── clientHandshakeFinished.json │ ├── clientHello.json │ ├── clientKeyExchange.json │ ├── clientKeyExchangeGeneration.json │ ├── index.js │ ├── serverApplicationData.json │ ├── serverCertificate.json │ ├── serverChangeCipherSpec.json │ ├── serverEncryptionKeysGeneration.json │ ├── serverHandshakeFinished.json │ ├── serverHello.json │ ├── serverHelloDone.json │ ├── serverKeyExchange.json │ └── serverKeyExchangeGeneration.json ├── TLS13/ │ ├── clientApplicationData.json │ ├── clientApplicationKeysCalc.json │ ├── clientChangeCipherSpec.json │ ├── clientHandshakeFinished.json │ ├── clientHandshakeKeysCalc.json │ ├── clientHello.json │ ├── clientKeyExchangeGeneration.json │ ├── index.js │ ├── serverApplicationData.json │ ├── serverApplicationKeysCalc.json │ ├── serverCertVerify.json │ ├── serverCertificate.json │ ├── serverChangeCipherSpec.json │ ├── serverEncryptedExtensions.json │ ├── serverHandshakeFinished.json │ ├── serverHandshakeKeysCalc.json │ ├── serverHello.json │ ├── serverKeyExchangeGeneration.json │ ├── serverNewSessionTicket1.json │ ├── serverNewSessionTicket2.json │ ├── wrappedRecord1.json │ ├── wrappedRecord2.json │ ├── wrappedRecord3.json │ ├── wrappedRecord4.json │ ├── wrappedRecord5.json │ ├── wrappedRecord6.json │ ├── wrappedRecord7.json │ ├── wrappedRecord8.json │ └── wrappedRecord9.json ├── X25519/ │ ├── handsOn.json │ ├── index.js │ ├── mathOnTheCurve.json │ ├── overview.json │ └── q&a.json ├── common.css ├── context/ │ └── slugger.js ├── hard-encoded.css ├── illustrated.css ├── index.js ├── router.js └── utils.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/gh-pages.yml ================================================ name: deploy gh-pages on: pull_request: types: [closed] branches: [master] push: branches: [master] jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ uses: actions/checkout@v2 - name: Environment Setup 🔧 uses: actions/setup-node@v4 with: node-version: "18.x" - name: Cache dependencies 🍪 uses: actions/cache@v4 id: cache with: path: | **/.npm **/node_modules/ key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} restore-keys: | ${{ runner.os }}-node- - name: Install dependencies without Proxy 📁 # only install when cache miss or package.json changed if: steps.cache.outputs.cache-hit != 'true' run: npm --proxy=null --https_proxy=null --strict-ssl=true install - name: Cache buildings 🏗 uses: actions/cache@v4 id: building with: path: | **/.parcel-cache/ **/dist/ key: ${{ runner.os }}-build - name: Build 🚧 run: npm run build - name: Deploy 🚀 uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_branch: gh-pages publish_dir: ./dist ================================================ FILE: .gitignore ================================================ build dist node_modules .parcel-cache *.local yarn.lock package-lock.json ================================================ FILE: .npmrc ================================================ registry = https://registry.npmmirror.com/ ================================================ FILE: .parcelrc ================================================ { "extends": [ "@parcel/config-default" ], "reporters": [ "...", "parcel-reporter-static-files-copy" ] } ================================================ FILE: .prettierrc ================================================ { "trailingComma": "es5", "singleQuote": false, "tabWidth": 2, "semi": true, "endOfLine": "lf" } ================================================ FILE: .vscode/settings.json ================================================ { "cSpell.words": ["middleboxes", "middlebox", "DTLS", "QUIC"] } ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2023 Allen Lee Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # illustrate QUIC, TLS 1.2, TLS 1.3, DTLS 中文翻译 图解 QUIC, TLS 1.2, TLS 1.3, DTLS 协议的连接及会话过程 翻译自: - https://quic.xargs.org/ - https://dtls.xargs.org/ - https://tls12.xargs.org/ - https://tls13.xargs.org/ - https://x25519.xargs.org/ 原作者 [syncsynchalt](https://github.com/syncsynchalt), 译者 [AllenLee](https://github.com/cangSDARM) ## 进度 - [x] QUIC - [x] DTLS - [x] TLS 1.2 - [x] TLS 1.3 - [x] x25519 ================================================ FILE: frombootstrap.css ================================================ /* everything we wanted from bootstrap but nothing more */ *, *::before, *::after { box-sizing: border-box; } html { line-height: 1.15; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; -ms-overflow-style: scrollbar; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #212529; text-align: left; background-color: #fff; } p { margin-top: 0; margin-bottom: 1rem; } a { color: #007bff; text-decoration: none; background-color: transparent; -webkit-text-decoration-skip: objects; } a:hover { color: #0056b3; text-decoration: underline; } pre, code, kbd, samp { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 1em; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { margin-top: 0; margin-bottom: 0.5rem; font-weight: 500; line-height: 1.2; } h1, .h1 { font-size: 2.5rem; } h2, .h2 { font-size: 2rem; } h3, .h3 { font-size: 1.75rem; } h4, .h4 { font-size: 1.5rem; } h5, .h5 { font-size: 1.25rem; } h6, .h6 { font-size: 1rem; } pre { display: block; font-size: 87.5%; color: #212529; } table { background-color: transparent; border-spacing: 0; border-collapse: collapse; } td, th { padding: 0; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #ddd; } .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #ddd; } .table .table { background-color: #fff; } .table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td { padding: 5px; } table col[class*="col-"] { position: static; display: table-column; float: none; } table td[class*="col-"], table th[class*="col-"] { position: static; display: table-cell; float: none; } .container { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } @media (min-width: 400px) { .container { padding-left: 5px; padding-right: 5px; } } @media (min-width: 768px) { .container { max-width: 720px; } } @media (min-width: 992px) { .container { max-width: 960px; } } @media (min-width: 1200px) { .container { max-width: 1140px; } } ================================================ FILE: index.html ================================================ 图解
[print, TODO] ================================================ FILE: package.json ================================================ { "name": "illustrate", "version": "1.0.0", "description": "", "scripts": { "start": "parcel index.html", "format": "prettier --write \"./src/**/*.{js,jsx,css,scss}\"", "rm:cache": "rimraf .parcel-cache && rimraf ./dist", "build": "npm run rm:cache && parcel build index.html --public-url ./" }, "author": "AllenLee<648384410li@gmail.com>", "license": "MIT", "staticFiles": { "staticPath": "public" }, "devDependencies": { "parcel": "^2.8.3", "parcel-reporter-static-files-copy": "^1.5.0", "prettier": "^2.8.7", "process": "^0.11.10", "rimraf": "^5.0.1" }, "dependencies": { "clsx": "^1.2.1", "github-slugger": "^2.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-wrap-balancer": "^0.4.0" } } ================================================ FILE: print.js ================================================ globalThis.illustrate = { printMode: () => { // add printmode css let inject = document.createElement("link"); inject.setAttribute("rel", "stylesheet"); inject.setAttribute("href", "printmode.css"); document.head.appendChild(inject); // open everything up // TODO: // [].forEach.call(document.querySelectorAll(".record, .calculation"), (el) => { // el.classList.add("selected"); // el.classList.add("annotate"); // }); // [].forEach.call(document.querySelectorAll("codesample"), (el) => { // el.classList.add("show"); // }); [].forEach.call(document.querySelectorAll("*"), (el) => { el.onclick = null; }); } }; ================================================ FILE: printmode.css ================================================ /* print mode */ @media (min-width: 0) { .container { max-width: none !important; margin: 5px 0 !important; } } *, *:hover { color: #000 !important; background-color: #fff !important; text-shadow: none !important; } .illustration { display: none !important; } button { display: none !important; } .client, .server { background-color: #fff !important; border: 1px solid black !important; box-shadow: none !important; max-width: none !important; margin: 1em 0; } .rec-label:after { content: "" !important; } .string > .explanation, .decryption > .explanation { background-color: #fff !important; box-shadow: none !important; border: 2px solid black !important; } .record.annotate .string > .explanation:before { display: none; } pre code { border-radius: 0 !important; border: 2px solid black !important; white-space: pre-wrap !important; } a:after { content: " [link]"; } a.no-show:after { content: ""; } .print-mode { display: none; } .header { display: none; } ================================================ FILE: public/.nojekyll ================================================ ================================================ FILE: public/404.html ================================================ Single Page Apps for GitHub Pages ================================================ FILE: public/sitemap.xml ================================================ https://cangsdarm.github.io/illustrate/ weekly 0.5 https://cangsdarm.github.io/illustrate/quic weekly 0.5 https://cangsdarm.github.io/illustrate/dtls weekly 0.5 https://cangsdarm.github.io/illustrate/tls13 weekly 0.5 https://cangsdarm.github.io/illustrate/tls12 weekly 0.5 ================================================ FILE: src/App.jsx ================================================ import React from "react"; import "./common.css"; import "./hard-encoded.css"; import "./illustrated.css"; import Header from "./Header"; import Intro from "./Intro"; import { routers, base } from "./router"; import RecOuter from "./RecOuter"; import { SluggerContextProvider } from "./context/slugger"; import Datagram from "./Datagram"; import Footer from "./Footer"; const App = () => { const [curPage, setCurPage] = React.useState(); const [loading, setLoading] = React.useState(false); const [JSON, setJSON] = React.useState({}); React.useEffect(() => { curPage?.json().then((json) => { setJSON(json?.default || json); setLoading(false); }); }, [curPage]); return ( <>
{ window.document.title = rt.title; setLoading(true); setCurPage(rt); }} /> {loading ? (
loading...
) : ( {(function () { let datagramMeta = { name: "", children: [], length: 0 }; return JSON?.sections?.map((sec) => { const { type, tags, datagram, ...restSec } = sec; const key = sec.id || sec.label; if (type === "Datagram") { datagramMeta.name = sec.label; datagramMeta.length = datagram; datagramMeta.children = []; return undefined; } if (datagramMeta.name) { let newLen = datagramMeta.children.length; if (newLen < datagramMeta.length) { newLen = datagramMeta.children.push( ); } if (newLen < datagramMeta.length) { return undefined; } else { const { name, children } = datagramMeta; datagramMeta = {}; return ( ); } } return ; }); })()}