在接受挑战后,我似乎无法找到TLS响应中应包含的格式。我在哪里可以找到该信息?
说我在PHP中这样做,如果它看起来像:
$nonce = "somenoncevaluehere";
$qop = "auth";
$charset = "utf-8";
$algorithm = "md5-sess";
$server = "example.com";
$user = "bob";
$pass = "somepass";
$md5Response = "realm=$server,nonce=$nonce,qop=$qop,charset=$charset,algorithm=$algorithm,xmpp,$server,$user,$pass";
答案 0 :(得分:0)
我找到了cocoa version
NSMutableString *buffer = [NSMutableString stringWithCapacity:100];
[buffer appendFormat:@"username=\"%@\",", username];
[buffer appendFormat:@"realm=\"%@\",", realm];
[buffer appendFormat:@"nonce=\"%@\",", nonce];
[buffer appendFormat:@"cnonce=\"%@\",", cnonce];
[buffer appendFormat:@"nc=00000001,"];
[buffer appendFormat:@"qop=auth,"];
[buffer appendFormat:@"digest-uri=\"%@\",", digestURI];
[buffer appendFormat:@"response=%@,", [self response]];
[buffer appendFormat:@"charset=utf-8"];
NSLog(@"decoded response: %@", buffer);
NSData *utf8data = [buffer dataUsingEncoding:NSUTF8StringEncoding];
return [utf8data encodeBase64];