[HTML] 纯文本查看 复制代码 HA1 = hex_md5(username+ ":" + Authrealm + ":" + passwd);
HA2 = hex_md5("GET" + ":" + "/cgi/protected.cgi");
rand = Math.floor(Math.random()*100001)
date = new Date().getTime();
salt = rand+""+date;
tmp = hex_md5(salt);
AuthCnonce = tmp.substring(0,16);
DigestRes = hex_md5(HA1 + ":" + nonce + ":" + "00000001" + ":" + AuthCnonce + ":" + AuthQop + ":" + HA2);
url = window.location.protocol + "//" + window.location.host + "/login.cgi?Action=Digest&username="+username+"&realm="+Authrealm+"&nonce="+nonce+"&response="+DigestRes+"&qop="+AuthQop+"&cnonce="+AuthCnonce + "&temp=asr";
if(login_done(authentication(url))) {
strResponse = "Digest username=\"" + username + "\", realm=\"" + Authrealm + "\", nonce=\"" + nonce + "\", uri=\"" + "/cgi/protected.cgi" + "\", response=\"" + DigestRes + "\", qop=" + AuthQop + ", nc=00000001" + ", cnonce=\"" + AuthCnonce + "\"" ;
有必要弄出来DigestRes 的值嘛,我随便弄一个发现也行,但是不知道会不会长久 |