Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 272200 | Differences between
and this patch

Collapse All | Expand All

(-)./core/controllers/misc/dependencyCheck.py.old (-9 lines)
Lines 95-109 Link Here
95
        except:
95
        except:
96
            print 'You have to install pyPdf lib. Debian based distributions: apt-get install python-pypdf'
96
            print 'You have to install pyPdf lib. Debian based distributions: apt-get install python-pypdf'
97
            sys.exit( 1 )
97
            sys.exit( 1 )
98
    
99
    try:
100
        from extlib.jsonpy import json as json
101
    except:
102
        try:
103
            import json
104
        except:
105
            print 'You have to install python-json lib. Debian based distributions: apt-get install python-json'
106
            sys.exit( 1 )
107
            
98
            
108
    try:
99
    try:
109
        from OpenSSL import SSL
100
        from OpenSSL import SSL
(-)core/data/fuzzer/fuzzer.py.old (-4 / +4 lines)
Lines 38-46 Link Here
38
from core.data.dc.cookie import cookie as cookie
38
from core.data.dc.cookie import cookie as cookie
39
from core.data.dc.dataContainer import dataContainer as dc
39
from core.data.dc.dataContainer import dataContainer as dc
40
try:
40
try:
41
    from extlib.jsonpy import json as json
41
    import extlib.simplejson as json
42
except:
42
except:
43
    import json
43
    import simplejson as json
44
from core.data.request.httpPostDataRequest import httpPostDataRequest
44
from core.data.request.httpPostDataRequest import httpPostDataRequest
45
from core.data.request.httpQsRequest import httpQsRequest
45
from core.data.request.httpQsRequest import httpQsRequest
46
46
Lines 210-216 Link Here
210
    
210
    
211
    # Now, fuzz the parsed JSON data...
211
    # Now, fuzz the parsed JSON data...
212
    postdata = freq.getData()
212
    postdata = freq.getData()
213
    jsonPostData = json.read( postdata )
213
    jsonPostData = json.loads( postdata )
214
    return _makeMutants( freq, mutantClass, mutant_str_list, fuzzableParamList , append, jsonPostData )
214
    return _makeMutants( freq, mutantClass, mutant_str_list, fuzzableParamList , append, jsonPostData )
215
215
216
def isJSON( freq ):
216
def isJSON( freq ):
Lines 222-228 Link Here
222
        # We have something that's not URL encoded in the postdata, it could be something
222
        # We have something that's not URL encoded in the postdata, it could be something
223
        # like JSON, XML, or multipart encoding. Let's try with JSON
223
        # like JSON, XML, or multipart encoding. Let's try with JSON
224
        try:
224
        try:
225
            jsonPostData = json.read( postdata )
225
            jsonPostData = json.loads( postdata )
226
        except:
226
        except:
227
            # It's not json, maybe XML or multipart, I don't really care ( at least not in this section of the code )
227
            # It's not json, maybe XML or multipart, I don't really care ( at least not in this section of the code )
228
            return False
228
            return False
(-)core/data/request/frFactory.py.old (-3 / +3 lines)
Lines 37-45 Link Here
37
37
38
# for json
38
# for json
39
try:
39
try:
40
    from extlib.jsonpy import json as json
40
    import extlib.simplejson as json
41
except:
41
except:
42
    import json
42
    import simplejson as json
43
43
44
from core.controllers.w3afException import w3afException
44
from core.controllers.w3afException import w3afException
45
import core.controllers.outputManager as om
45
import core.controllers.outputManager as om
Lines 200-206 Link Here
200
        #   Case #2, JSON request
200
        #   Case #2, JSON request
201
        #
201
        #
202
        try:
202
        try:
203
            dc = json.read( postData )
203
            dc = json.loads( postData )
204
        except:
204
        except:
205
            pass
205
            pass
206
        else:
206
        else:
(-)core/data/request/jsonPostDataRequest.py.old (-4 / +4 lines)
Lines 25-33 Link Here
25
from core.data.request.httpPostDataRequest import httpPostDataRequest
25
from core.data.request.httpPostDataRequest import httpPostDataRequest
26
import core.data.dc.dataContainer as dc
26
import core.data.dc.dataContainer as dc
27
try:
27
try:
28
    from extlib.jsonpy import json as json
28
    import extlib.simplejson as json
29
except:
29
except:
30
    import json
30
    import simplejson
31
31
32
class jsonPostDataRequest(httpPostDataRequest):
32
class jsonPostDataRequest(httpPostDataRequest):
33
    '''
33
    '''
Lines 43-49 Link Here
43
        '''
43
        '''
44
        @return: A string that represents the JSON data saved in the dc.
44
        @return: A string that represents the JSON data saved in the dc.
45
        '''
45
        '''
46
        res = json.write(self._dc)
46
        res = json.dumps(self._dc)
47
        return res
47
        return res
48
        
48
        
49
    def __str__( self ):
49
    def __str__( self ):
Lines 54-60 Link Here
54
        strRes += self._url
54
        strRes += self._url
55
        strRes += ' | Method: ' + self._method
55
        strRes += ' | Method: ' + self._method
56
        strRes += ' | JSON: ('
56
        strRes += ' | JSON: ('
57
        strRes += json.write(self._dc)
57
        strRes += json.dumps(self._dc)
58
        strRes += ')'
58
        strRes += ')'
59
        return strRes
59
        return strRes
60
    
60
    

Return to bug 272200