Mercurial > hg > orthanc
comparison OrthancServer/OrthancInitialization.cpp @ 2352:3ab96768d144
Fix issue #52 (DICOM level security association problems)
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 18 Jul 2017 17:33:26 +0200 |
parents | 9c7a80c87ae9 |
children | 96b3ec054b69 |
comparison
equal
deleted
inserted
replaced
2351:56504f89d4ac | 2352:3ab96768d144 |
---|---|
853 | 853 |
854 return false; | 854 return false; |
855 } | 855 } |
856 | 856 |
857 | 857 |
858 bool Configuration::IsKnownAETitle(const std::string& aet) | 858 bool Configuration::IsKnownAETitle(const std::string& aet, |
859 const std::string& ip) | |
859 { | 860 { |
860 RemoteModalityParameters modality; | 861 RemoteModalityParameters modality; |
861 return LookupDicomModalityUsingAETitle(modality, aet); | 862 |
863 if (!LookupDicomModalityUsingAETitle(modality, aet)) | |
864 { | |
865 LOG(WARNING) << "Modality \"" << aet | |
866 << "\" is not listed in the \"DicomModalities\" configuration option"; | |
867 return false; | |
868 } | |
869 else if (!Configuration::GetGlobalBoolParameter("DicomCheckModalityHost", false) || | |
870 ip == modality.GetHost()) | |
871 { | |
872 return true; | |
873 } | |
874 else | |
875 { | |
876 LOG(WARNING) << "Forbidding access from AET \"" << aet | |
877 << "\" given its hostname (" << ip << ") does not match " | |
878 << "the \"DicomModalities\" configuration option (" | |
879 << modality.GetHost() << " was expected)"; | |
880 return false; | |
881 } | |
862 } | 882 } |
863 | 883 |
864 | 884 |
865 RemoteModalityParameters Configuration::GetModalityUsingSymbolicName(const std::string& name) | 885 RemoteModalityParameters Configuration::GetModalityUsingSymbolicName(const std::string& name) |
866 { | 886 { |