bacula 用の python クライアントを作成しようとしていますが、認証に問題があります。
アルゴリズムは次のとおりです。
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の実装を移植するよりも簡単な方法はありますか?
整数 bin_to_base64(char *buf、int buflen、char *bin、int binlen、int 互換) { uint32_t reg、保存、マスク; int rem、私; int j = 0; reg = 0; レム = 0; ブフレン--; /* EOS の保存を許可します */ for (i=0; i >= (rem - 6); もし (j