lib/DAV/plugins/auth/abstractDigest.js
function(handler, cbvalidate) {
        var req   = handler.httpRequest;
        var A2    = req.method + ":" + this.digestParts["uri"];
        var self  = this;

        if (this.digestParts["qop"] == "auth-int") {
            // Making sure we support this qop value
            if (!(this.qop & QOP_AUTHINT))
                return cbvalidate(false);
            // We need to add an md5 of the entire request body to the A2 part of the hash
            handler.getRequestBody("utf8", null, false, function(noop, body) {
                A2 += ":" + Util.createHash(body);
                afterBody();
            });
        }
        else {
            // We need to make sure we support this qop value
            if (!(this.qop & QOP_AUTH))
                return cbvalidate(false);
            afterBody();
        }

        function afterBody() {
            A2 = Util.createHash(A2);

            var validResponse = Util.createHash(self.A1 + ":" + self.digestParts["nonce"] + ":"
                + self.digestParts["nc"] + ":" + self.digestParts["cnonce"] + ":"
                + self.digestParts["qop"] + ":" + A2);

            cbvalidate(self.digestParts["response"] == validResponse);
        }
    }
function(handler, cbvalidate) {
        var req   = handler.httpRequest;
        var A2    = req.method + ":" + this.digestParts["uri"];
        var self  = this;

        if (this.digestParts["qop"] == "auth-int") {
            // Making sure we support this qop value
            if (!(this.qop & QOP_AUTHINT))
                return cbvalidate(false);
            // We need to add an md5 of the entire request body to the A2 part of the hash
            handler.getRequestBody("utf8", null, false, function(noop, body) {
                A2 += ":" + Util.createHash(body);
                afterBody();
            });
        }
        else {
            // We need to make sure we support this qop value
            if (!(this.qop & QOP_AUTH))
                return cbvalidate(false);
            afterBody();
        }

        function afterBody() {
            A2 = Util.createHash(A2);

            var validResponse = Util.createHash(self.A1 + ":" + self.digestParts["nonce"] + ":"
                + self.digestParts["nc"] + ":" + self.digestParts["cnonce"] + ":"
                + self.digestParts["qop"] + ":" + A2);

            cbvalidate(self.digestParts["response"] == validResponse);
        }
    }
function ( handler , cbvalidate ) { var req = handler . httpRequest ; var A2 = req . method + ":" + this . digestParts [ "uri" ] ; var self = this ; if ( this . digestParts [ "qop" ] == "auth-int" ) { // Making sure we support this qop value if ( ! ( this . qop & QOP_AUTHINT ) ) return cbvalidate ( false ) ; // We need to add an md5 of the entire request body to the A2 part of the hash handler . getRequestBody ( "utf8" , null , false , function ( noop , body ) { A2 += ":" + Util . createHash ( body ) ; afterBody ( ) ; } ) ; } else { // We need to make sure we support this qop value if ( ! ( this . qop & QOP_AUTH ) ) return cbvalidate ( false ) ; afterBody ( ) ; } function afterBody ( ) { A2 = Util . createHash ( A2 ) ; var validResponse = Util . createHash ( self . A1 + ":" + self . digestParts [ "nonce" ] + ":" + self . digestParts [ "nc" ] + ":" + self . digestParts [ "cnonce" ] + ":" + self . digestParts [ "qop" ] + ":" + A2 ) ; cbvalidate ( self . digestParts [ "response" ] == validResponse ) ; } }
Validates the digest challenge

@return bool
Validates the digest challenge