惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
S
Securelist
V
Vulnerabilities – Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
Simon Willison's Weblog
Simon Willison's Weblog
Hacker News - Newest:
Hacker News - Newest: "LLM"
P
Palo Alto Networks Blog
T
Troy Hunt's Blog
SecWiki News
SecWiki News
Security Archives - TechRepublic
Security Archives - TechRepublic
T
The Blog of Author Tim Ferriss
Project Zero
Project Zero
Microsoft Security Blog
Microsoft Security Blog
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
F
Full Disclosure
阮一峰的网络日志
阮一峰的网络日志
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Attack and Defense Labs
Attack and Defense Labs
Know Your Adversary
Know Your Adversary
WordPress大学
WordPress大学
PCI Perspectives
PCI Perspectives
N
News | PayPal Newsroom
The Last Watchdog
The Last Watchdog
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
CERT Recently Published Vulnerability Notes
H
Help Net Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
云风的 BLOG
云风的 BLOG
月光博客
月光博客
T
The Exploit Database - CXSecurity.com
I
InfoQ
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
腾讯CDC
小众软件
小众软件
V2EX - 技术
V2EX - 技术
罗磊的独立博客
Cloudbric
Cloudbric
Recorded Future
Recorded Future
IT之家
IT之家
Google DeepMind News
Google DeepMind News
C
CXSECURITY Database RSS Feed - CXSecurity.com

Lua

用 Lua 写 Android 应用? AutoLua 做到了 - V2EX Android 上直接用 Lua 调 Java API 写脚本——AutoLua 技术分享 - V2EX 使用 Android Lua Helper 在 VSCODE 中调试安卓 Lua 应用 - V2EX 奇怪的小问题 - V2EX Lua 代码上的优化,相互学习一下 - V2EX openresty + lua 这个地方怎么写 - V2EX 求一份 lua 入门教程 - V2EX 有关 Lua 调用 C++ 编译动态库程序 - V2EX 飞书 + Lua 实现企业级组织架构登录认证 - V2EX 为什么游戏架构要用事件来驱动? - V2EX vscode 上写 lua 有显示注释的插件吗? - V2EX lua 为什么要使用~=当作不等于运算符? - V2EX 请问现在 lua 混淆用什么工具,求常年 lua 的老哥指点 - V2EX lua 的前景如何? - V2EX core_framework - 基于 libev 的轻量级 lua 网络开发框架 如何构建伪视频流服务? 低延时低采样, 基于 OpenResty , HTTP, 内网... TP-Link 官方使用的是开源固件? 表达过去、现在与将来:之将来(1) - V2EX 有个问题, lua 平时能用来做做什么 - V2EX ngx_lua 遇到的一个小坑 - V2EX Lua IDE 各位 V 友,用 lua 作为开发语言用什么 IDE 可以方便代码提示以及调试呢 - V2EX Lua 怎么实现 php strstr() 函数的功能 - V2EX 使用 Sol2 来进行 Lua 绑定 - V2EX luarocks 使用上的一些小技巧 - V2EX 正在用 lua 写一个 nginx 防盗链的拓展,遇到了一个问题。 - V2EX 9k-18k 宁波 经验 3-5 年 本科及以上 全职 职位诱惑 : 年终奖 出国旅游 顶级办公设备及环境 - V2EX 关于 Lua 的标准库 - V2EX Torch - V2EX 一个在 MediaWiki 里面加入 Lua 脚本的插件 - V2EX ngx_lua_reqstatus 实时监控 Nginx 域名 qps 的 lua 拓展 - V2EX 首页搜索到 14 个 python,现在应该是 15 个了,为神马没有 lua 一席之地 - V2EX 学习 ngx_lua - V2EX 用 Lua 写 Telegram 的 Bot - V2EX Lua 资料收集整理 - V2EX 云风翻译了 Lua 5.3 的手册 - V2EX 我对 Lua coroutine 的理解,希望有人能指点下有哪些更适合的使用场景或高阶用法~ - V2EX Lua 5.3 - V2EX 为什么 Lua 本身不包含像 endswith() 之类的特别常用的字符串函数呢? - V2EX 为 Atom 写了一个 linter-luacheck,希望大家喜欢 - V2EX lua 如何最快速度入门 - V2EX 学习 Lua,请问各位有什么书推荐? - V2EX lua 很牛啊,有人在服务端用 ta 么? - V2EX LÖVE - V2EX Scripting Nginx with Lua - V2EX 关于 openssl aes-256-cbc 的一些参数 - V2EX LuaJIT 2.1 PPA - V2EX 谁会Luci的cbi模块?怎样实现重启服务? - V2EX lua有没有3des加密解密的模块? - V2EX 关于学习 Lua 有什么好书推荐么? - V2EX lua好像有种简化的语法,叫啥来着 - V2EX
skynet 怎么给 mysql drive 增加对 caching_sha2_password 的支持 - V2EX
awanganddong · 2025-03-10 · via Lua

mysql 用的是 8.0 。插件是 caching_sha2_password

skynet 默认扩展不支持这种模式。 所以想请教下这种怎么改写。 也看了 https://github.com/openresty/lua-resty-mysql 源码。还是一脑袋浆糊。

        if auth_plugin == "caching_sha2_password" then
            token = _compute_caching_sha2_password_token(password, scramble)
        else
            token = _compute_token(password, scramble)
        end
        local client_flags = 260047
        local req = strpack("<I4I4c1c23zs1z",
                client_flags,
                self._max_packet_size,
                strchar(charset),
                strrep("\0", 23),
                user,
                token,
                database
        )
        local authpacket = _compose_packet(self, req)
        sockchannel:request(authpacket, dispatch_resp)
        if on_connect then
            on_connect(self)
        end
        
        
        
        function _compute_caching_sha2_password_token(password, scramble)
    -- 1. Compute SHA-256 hash of the password
    local password_hash = sha.sha256(password)

    -- 2. Concatenate the hash with the scramble

    local combined = sha.sha256(sha.sha256(password_hash .. scramble))

    local token = xor(password_hash, combined)
    -- 3. Compute SHA-256 hash of the combined value
    return token
end

下边是我检索 chatgpt 来的,但是不对。请教下大家。