# HG changeset patch # User Sebastien Jodogne # Date 1586169409 -7200 # Node ID e9b7e05bcd421465d8f9649bd7366266f431ec2b # Parent 3ba143353f95653382370490b8952dc26b30c48f# Parent 2bf30ef727e3c0c0498be75eecb253efbb3c1070 integration mainline->transcoding diff -r 3ba143353f95 -r e9b7e05bcd42 AUTHORS --- a/AUTHORS Fri Mar 20 12:38:00 2020 +0100 +++ b/AUTHORS Mon Apr 06 12:36:49 2020 +0200 @@ -15,7 +15,7 @@ Belgium * Osimis S.A. - Rue du Bois Saint-Jean 15/1 - 4102 Seraing + Quai Banning 6 + 4000 Liege Belgium http://www.osimis.io/ diff -r 3ba143353f95 -r e9b7e05bcd42 Core/DicomNetworking/DicomUserConnection.cpp --- a/Core/DicomNetworking/DicomUserConnection.cpp Fri Mar 20 12:38:00 2020 +0100 +++ b/Core/DicomNetworking/DicomUserConnection.cpp Mon Apr 06 12:36:49 2020 +0200 @@ -736,9 +736,22 @@ { char buf[16]; sprintf(buf, "%04X", response.DimseStatus); - throw OrthancException(ErrorCode_NetworkProtocol, - "C-FIND SCU to AET \"" + remoteAet + - "\" has failed with DIMSE status 0x" + buf); + + if (response.DimseStatus == STATUS_FIND_Failed_UnableToProcess) + { + throw OrthancException(ErrorCode_NetworkProtocol, + HttpStatus_422_UnprocessableEntity, + "C-FIND SCU to AET \"" + remoteAet + + "\" has failed with DIMSE status 0x" + buf + + " (unable to process - invalid query ?)" + ); + } + else + { + throw OrthancException(ErrorCode_NetworkProtocol, + "C-FIND SCU to AET \"" + remoteAet + + "\" has failed with DIMSE status 0x" + buf); + } } } @@ -939,9 +952,22 @@ { char buf[16]; sprintf(buf, "%04X", response.DimseStatus); - throw OrthancException(ErrorCode_NetworkProtocol, - "C-MOVE SCU to AET \"" + remoteAet_ + - "\" has failed with DIMSE status 0x" + buf); + + if (response.DimseStatus == STATUS_MOVE_Failed_UnableToProcess) + { + throw OrthancException(ErrorCode_NetworkProtocol, + HttpStatus_422_UnprocessableEntity, + "C-MOVE SCU to AET \"" + remoteAet_ + + "\" has failed with DIMSE status 0x" + buf + + " (unable to process - resource not found ?)" + ); + } + else + { + throw OrthancException(ErrorCode_NetworkProtocol, + "C-MOVE SCU to AET \"" + remoteAet_ + + "\" has failed with DIMSE status 0x" + buf); + } } } @@ -1185,7 +1211,7 @@ void DicomUserConnection::Store(std::string& sopClassUid /* out */, std::string& sopInstanceUid /* out */, - const char* buffer, + const void* buffer, size_t size, const std::string& moveOriginatorAET, uint16_t moveOriginatorID) diff -r 3ba143353f95 -r e9b7e05bcd42 Core/DicomNetworking/DicomUserConnection.h --- a/Core/DicomNetworking/DicomUserConnection.h Fri Mar 20 12:38:00 2020 +0100 +++ b/Core/DicomNetworking/DicomUserConnection.h Mon Apr 06 12:36:49 2020 +0200 @@ -160,14 +160,14 @@ void Store(std::string& sopClassUid /* out */, std::string& sopInstanceUid /* out */, - const char* buffer, + const void* buffer, size_t size, const std::string& moveOriginatorAET, uint16_t moveOriginatorID); void Store(std::string& sopClassUid /* out */, std::string& sopInstanceUid /* out */, - const char* buffer, + const void* buffer, size_t size) { Store(sopClassUid, sopInstanceUid, buffer, size, "", 0); // Not a C-Move diff -r 3ba143353f95 -r e9b7e05bcd42 Core/Enumerations.cpp --- a/Core/Enumerations.cpp Fri Mar 20 12:38:00 2020 +0100 +++ b/Core/Enumerations.cpp Mon Apr 06 12:36:49 2020 +0200 @@ -189,6 +189,9 @@ case ErrorCode_BadGeometry: return "Geometry error encountered in Stone"; + case ErrorCode_SslInitialization: + return "Cannot initialize SSL encryption, check out your certificates"; + case ErrorCode_SQLiteNotOpened: return "SQLite: The database is not opened"; diff -r 3ba143353f95 -r e9b7e05bcd42 Core/Enumerations.h --- a/Core/Enumerations.h Fri Mar 20 12:38:00 2020 +0100 +++ b/Core/Enumerations.h Mon Apr 06 12:36:49 2020 +0200 @@ -180,6 +180,7 @@ ErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */, ErrorCode_CanceledJob = 37 /*!< This job was canceled */, ErrorCode_BadGeometry = 38 /*!< Geometry error encountered in Stone */, + ErrorCode_SslInitialization = 39 /*!< Cannot initialize SSL encryption, check out your certificates */, ErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */, ErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */, ErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */, diff -r 3ba143353f95 -r e9b7e05bcd42 Core/HttpServer/HttpServer.cpp --- a/Core/HttpServer/HttpServer.cpp Fri Mar 20 12:38:00 2020 +0100 +++ b/Core/HttpServer/HttpServer.cpp Mon Apr 06 12:36:49 2020 +0200 @@ -72,7 +72,8 @@ #endif #if ORTHANC_ENABLE_SSL == 1 -#include +# include +# include #endif #define ORTHANC_REALM "Orthanc Secure Area" @@ -1182,8 +1183,35 @@ if (!pimpl_->context_) { - throw OrthancException(ErrorCode_HttpPortInUse, - " (port = " + boost::lexical_cast(port_) + ")"); + bool isSslError = false; + +#if ORTHANC_ENABLE_SSL == 1 + for (;;) + { + unsigned long code = ERR_get_error(); + if (code == 0) + { + break; + } + else + { + isSslError = true; + char message[1024]; + ERR_error_string_n(code, message, sizeof(message) - 1); + LOG(ERROR) << "OpenSSL error: " << message; + } + } +#endif + + if (isSslError) + { + throw OrthancException(ErrorCode_SslInitialization); + } + else + { + throw OrthancException(ErrorCode_HttpPortInUse, + " (port = " + boost::lexical_cast(port_) + ")"); + } } LOG(WARNING) << "HTTP server listening on port: " << GetPortNumber() diff -r 3ba143353f95 -r e9b7e05bcd42 Core/Toolbox.cpp --- a/Core/Toolbox.cpp Fri Mar 20 12:38:00 2020 +0100 +++ b/Core/Toolbox.cpp Mon Apr 06 12:36:49 2020 +0200 @@ -1680,21 +1680,36 @@ #endif + +#if ORTHANC_ENABLE_SSL == 0 + /** + * OpenSSL is disabled + **/ void Toolbox::InitializeOpenSsl() { -#if ORTHANC_ENABLE_SSL == 1 + } + + void Toolbox::FinalizeOpenSsl() + { + } + + +#elif (ORTHANC_ENABLE_SSL == 1 && \ + OPENSSL_VERSION_NUMBER < 0x10100000L) + /** + * OpenSSL < 1.1.0 + **/ + void Toolbox::InitializeOpenSsl() + { // https://wiki.openssl.org/index.php/Library_Initialization SSL_library_init(); SSL_load_error_strings(); OpenSSL_add_all_algorithms(); ERR_load_crypto_strings(); -#endif } - void Toolbox::FinalizeOpenSsl() { -#if ORTHANC_ENABLE_SSL == 1 // Finalize OpenSSL // https://wiki.openssl.org/index.php/Library_Initialization#Cleanup #ifdef FIPS_mode_set @@ -1710,8 +1725,28 @@ CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); ERR_free_strings(); + } + + +#elif (ORTHANC_ENABLE_SSL == 1 && \ + OPENSSL_VERSION_NUMBER >= 0x10100000L) + /** + * OpenSSL >= 1.1.0. In this case, the initialization is + * automatically done by the functions of OpenSSL. + * https://wiki.openssl.org/index.php/Library_Initialization + **/ + void Toolbox::InitializeOpenSsl() + { + } + + void Toolbox::FinalizeOpenSsl() + { + } + +#else +# error "Support your platform here" #endif - } + std::string Toolbox::GenerateUuid() diff -r 3ba143353f95 -r e9b7e05bcd42 NEWS --- a/NEWS Fri Mar 20 12:38:00 2020 +0100 +++ b/NEWS Mon Apr 06 12:36:49 2020 +0200 @@ -2,6 +2,28 @@ =============================== +REST API +-------- + +* API version has been upgraded to 6 +* Added: + - "/modalities/{id}/store-straight": Synchronously send the DICOM instance in POST + body to another modality (alternative to command-line tools such as "storescu") + + +Maintenance +----------- + +* Source code repository moved from BitBucket to self-hosted server +* Fix OpenSSL initialization on Linux Standard Base +* Fix lookup form in Orthanc Explorer (wildcards not allowed in StudyDate) +* Fix signature of "OrthancPluginRegisterStorageCommitmentScpCallback()" in plugins SDK +* Error reporting on failure while initializing SSL +* Upgraded dependencies for static builds (notably on Windows): + - civetweb 1.12 + - openssl 1.1.1f + + Version 1.6.0 (2020-03-18) ========================== diff -r 3ba143353f95 -r e9b7e05bcd42 OrthancExplorer/explorer.js --- a/OrthancExplorer/explorer.js Fri Mar 20 12:38:00 2020 +0100 +++ b/OrthancExplorer/explorer.js Mon Apr 06 12:36:49 2020 +0200 @@ -431,7 +431,7 @@ // NB: "GenerateDicomDate()" is defined in "query-retrieve.js" var target = $('#lookup-study-date'); $('option', target).remove(); - target.append($('