Mercurial > hg > orthanc
comparison OrthancServer/main.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 | 03982a0db696 |
children | 2421c137c304 |
comparison
equal
deleted
inserted
replaced
2351:56504f89d4ac | 2352:3ab96768d144 |
---|---|
156 public: | 156 public: |
157 OrthancApplicationEntityFilter(ServerContext& context) : context_(context) | 157 OrthancApplicationEntityFilter(ServerContext& context) : context_(context) |
158 { | 158 { |
159 } | 159 } |
160 | 160 |
161 virtual bool IsAllowedConnection(const std::string& /*remoteIp*/, | 161 virtual bool IsAllowedConnection(const std::string& remoteIp, |
162 const std::string& /*remoteAet*/, | 162 const std::string& remoteAet, |
163 const std::string& /*calledAet*/) | 163 const std::string& calledAet) |
164 { | 164 { |
165 LOG(INFO) << "Incoming connection from AET " << remoteAet | |
166 << " on IP " << remoteIp << ", calling AET " << calledAet; | |
167 | |
165 return true; | 168 return true; |
166 } | 169 } |
167 | 170 |
168 virtual bool IsAllowedRequest(const std::string& /*remoteIp*/, | 171 virtual bool IsAllowedRequest(const std::string& remoteIp, |
169 const std::string& remoteAet, | 172 const std::string& remoteAet, |
170 const std::string& /*calledAet*/, | 173 const std::string& calledAet, |
171 DicomRequestType type) | 174 DicomRequestType type) |
172 { | 175 { |
173 if (type == DicomRequestType_Store) | 176 LOG(INFO) << "Incoming " << Orthanc::EnumerationToString(type) << " request from AET " |
177 << remoteAet << " on IP " << remoteIp << ", calling AET " << calledAet; | |
178 | |
179 if (type == DicomRequestType_Store && | |
180 Configuration::GetGlobalBoolParameter("DicomAlwaysAllowStore", true)) | |
174 { | 181 { |
175 // Incoming store requests are always accepted, even from unknown AET | 182 // Incoming store requests are always accepted, even from unknown AET |
176 return true; | 183 return true; |
177 } | 184 } |
178 | 185 |
179 if (!Configuration::IsKnownAETitle(remoteAet)) | 186 if (!Configuration::IsKnownAETitle(remoteAet, remoteIp)) |
180 { | 187 { |
181 LOG(ERROR) << "Unknown remote DICOM modality AET: \"" << remoteAet << "\""; | |
182 return false; | 188 return false; |
183 } | 189 } |
184 else | 190 else |
185 { | 191 { |
186 return true; | 192 return true; |