Exemple #1
0
    def initSigningStatus(self):

        #default path to check as file's path
        path = self.path

        #however for kexts, use their bundle
        # ->this avoids issue with where errSecCSInfoPlistFailed is returned when the kext's binary is checked
        if self.bundle and utils.isKext(self.bundle):

            #set path to bundle
            path = self.bundle

        #check the signature
        (status, self.signatureStatus,
         self.signingAuthorities) = utils.checkSignature(path, self.bundle)

        #check
        if 0 != status:

            #reset
            self.signatureStatus = None

            #reset
            self.signingAuthorities = []

        return
Exemple #2
0
    def initSigningStatus(self):

        #signing info
        signingInfo = {}

        #default path to check as file's path
        path = self.path

        #however for kexts, use their bundle
        # ->this avoids issue with where errSecCSInfoPlistFailed is returned when the kext's binary is checked
        if self.bundle and utils.isKext(self.bundle):

            #set path to bundle
            path = self.bundle

        #check the signature
        (status, signingInfo) = utils.checkSignature(path, self.bundle)

        #on success
        # ->save into class var
        if 0 == status:

            #save sig status
            self.signatureStatus = signingInfo['status']

            #save apple flag
            self.signedByApple = signingInfo['isApple']

            #save authorities
            self.signingAuthorities = signingInfo['authorities']

        return
Exemple #3
0
	def initSigningStatus(self):

		#signing info
		signingInfo = {}

		#default path to check as file's path
		path = self.path

		#however for kexts, use their bundle
		# ->this avoids issue with where errSecCSInfoPlistFailed is returned when the kext's binary is checked
		if self.bundle and utils.isKext(self.bundle):

			#set path to bundle
			path = self.bundle

		#check the signature
		(status, signingInfo) = utils.checkSignature(path, self.bundle)

		#on success
		# ->save into class var
		if 0 == status:

			#save sig status
			self.signatureStatus = signingInfo['status']

			#save apple flag
			self.signedByApple = signingInfo['isApple']

			#save authorities
			self.signingAuthorities = signingInfo['authorities']

		return
Exemple #4
0
	def initSigningStatus(self):

		#default path to check as file's path
		path = self.path

		#however for kexts, use their bundle
		# ->this avoids issue with where errSecCSInfoPlistFailed is returned when the kext's binary is checked
		if self.bundle and utils.isKext(self.bundle):

			#set path to bundle
			path = self.bundle

		#check the signature
		(status, self.signatureStatus, self.signingAuthorities) = utils.checkSignature(path, self.bundle)

		#check
		if 0 != status:

			#reset
			self.signatureStatus = None

			#reset
			self.signingAuthorities = []

		return
Exemple #5
0
 def get(self):
     signature = self.request.get("signature", None)
     timestamp = self.request.get("timestamp", None)
     nonce = self.request.get("nonce", None)
     echostr = self.request.get("echostr", None)
     
     if checkSignature(signature=signature, timestamp=timestamp, nonce=nonce, token=token):
         self.response.write(echostr)
     else:
         webapp2.abort(403)
Exemple #6
0
def entry(request):
    '''
    check the service
    :param request:
    :return:
    '''
    if request.method == 'GET':
        response = HttpResponse(checkSignature(request),content_type="text/plain")
    elif request.method == 'POST':
        response=  HttpResponse(responseMsg(request),content_type="application/xml")
    else:
        response = None
    print "response \n %s"%response
    return response