我已经从fons分叉了cl-mongo(常见的lisp MongoDB库)存储库,因为它已经不再需要维护,也不支持SCRAM-SHA-1登录过程.这是我的分支:https://github.com/mprelude/cl-mongo - 主要的变化是添加了对cl-scram的依赖(我的SCRAM实现),并添加了一个bson二进制通用容器.
我仍在尝试发送初始消息,因此问题不在于密码错误,因为尚未使用.
为什么这部分身份验证失败了?如果我希望将MESSAGE中的内容传送给mongo,是否有人可以确认BINARY-MESSAGE是否应该发送给我?
这是我的调用,增加了一些调试输出:
* (asdf:load-system :cl-mongo)
T
* (cl-mongo:db.use "test")
"test"
* (cl-mongo:db.auth "aurumrw" "pencil" :mechanism :SCRAM-SHA-1)
(kv-container : #(#S(CL-MONGO::PAIR :KEY saslStart :VALUE 1)
#S(CL-MONGO::PAIR :KEY mechanism :VALUE SCRAM-SHA-1)
#S(CL-MONGO::PAIR
:KEY payload
:VALUE [CL-MONGO::BSON-BINARY-GENERIC] [binary data of type 0] ))
((CL-MONGO::BINARY-MESSAGE
. #(98 105 119 115 98 106 49 104 100 88 74 49 98 88 74 51 76 72 73 57 83 87
116 122 101 84 100 78 101 …Run Code Online (Sandbox Code Playgroud) 注意:我已经阅读了这个问题的非常好的答案,但它没有回答我的问题.
我正在尝试在Common Lisp中实现RFC 5802规定的SCRAM-SHA1身份验证标准.在生成客户端最终响应消息时,我遇到了问题.
这是函数的代码(其余函数在这里可用) - 这是尝试实现RFC的第7页所述的算法:
(defun gen-client-final-message
(&key password client-nonce client-initial-message server-response)
(check-type client-nonce string)
(check-type client-initial-message string)
(check-type server-response string)
(check-type password string)
"Takes a password, the initial client nonce, the initial client message & the server response.
Generates the final client message, and returns it along with the server signature."
(progn
(if (eq nil (parse-server-nonce :nonce client-nonce :response server-response)) NIL)
(let* ((final-message-bare (format nil "c=biws,r=~a" (parse-server-nonce :nonce client-nonce
:response server-response))) …Run Code Online (Sandbox Code Playgroud)