私はbacula用のPythonクライアントを作成しようとしましたが、認証に問題があります。Base64と非標準
アルゴリズムは次のとおりです。
import hmac
import base64
import re
...
challenge = re.search("auth cram-md5()", data)
#exemple ''
passwd = 'b489c90f3ee5b3ca86365e1bae27186e'
hm = hmac.new(passwd, challenge).digest()
rep = base64.b64encode(hm).strp().rstrip('=')
#result with python : 9zKE3VzYQ1oIDTpBuMMowQ
#result with bacula client : 9z+E3V/YQ1oIDTpBu8MowB'
ベース64のポートのBaculaのimplemenationよりも簡単な方法がありますか?あなたのCRAM-MD5実装を確認するには
int bin_to_base64(char *buf, int buflen, char *bin, int binlen, int compatible) { uint32_t reg, save, mask; int rem, i; int j = 0; reg = 0; rem = 0; buflen--; /* allow for storing EOS */ for (i=0; i >= (rem - 6); if (j
タイトルと投稿の両方が途中で途切れているようです。 –