File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -596,6 +596,7 @@ def _bearer_confirmed(self, data):
596
596
if data .address :
597
597
if not valid_address (data .address ):
598
598
return False
599
+ # verify that I got it from the correct sender
599
600
600
601
# These two will raise exception if untrue
601
602
validate_on_or_after (data .not_on_or_after , self .timeslack )
@@ -824,6 +825,28 @@ def session_info(self):
824
825
def __str__ (self ):
825
826
return "%s" % self .xmlstr
826
827
828
+ def verify_attesting_entity (self , address ):
829
+ """
830
+ Assumes one assertion. At least one address specification has to be
831
+ correct.
832
+
833
+ :param address: IP address of attesting entity
834
+ :return: True/False
835
+ """
836
+
837
+ correct = 0
838
+ for subject_conf in self .assertion .subject .subject_confirmation :
839
+ if subject_conf .subject_confirmation_data .address :
840
+ if subject_conf .subject_confirmation_data .address == address :
841
+ correct += 1
842
+ else :
843
+ correct += 1
844
+
845
+ if correct :
846
+ return True
847
+ else :
848
+ return False
849
+
827
850
828
851
class AuthnQueryResponse (AuthnResponse ):
829
852
msgtype = "authn_query_response"
@@ -982,3 +1005,4 @@ def _postamble(self):
982
1005
logger .debug ("response: %s" % (self .response ,))
983
1006
984
1007
return self
1008
+
You can’t perform that action at this time.
0 commit comments