"Find values set over SSL that later go cleartext"
from pmcheck import *
from pmutil import *

class ssl_val_sent_clear(check):
	"Find values set over SSL that later go cleartext"

	def run(self, pmd):
		for sv in pmd.SecureValues:
			if sv in trivial_values: continue
			if sv in pmd.ClearValues:
				for cv in pmd.ClearValues[sv]:
					# XXX: should say where it was set and seen (qs, pp, cookie)
					desc = "[*] Value set over SSL sent clear: %s as %s" % (sv, cv['name'])
					id = cv['httpparams']['id']
					self.add_single(desc, id=id)


