33 #include "dcmtk/config/osconfig.h" 34 #include "dcmtk/dcmnet/dcmlayer.h" 35 #include "dcmtk/ofstd/ofstream.h" 36 #include "dcmtk/oflog/oflog.h" 40 #include <openssl/ssl.h> 45 #define DCMTLS_TRACE(msg) OFLOG_TRACE(DCM_dcmtlsGetLogger(), msg) 46 #define DCMTLS_DEBUG(msg) OFLOG_DEBUG(DCM_dcmtlsGetLogger(), msg) 47 #define DCMTLS_INFO(msg) OFLOG_INFO(DCM_dcmtlsGetLogger(), msg) 48 #define DCMTLS_WARN(msg) OFLOG_WARN(DCM_dcmtlsGetLogger(), msg) 49 #define DCMTLS_ERROR(msg) OFLOG_ERROR(DCM_dcmtlsGetLogger(), msg) 50 #define DCMTLS_FATAL(msg) OFLOG_FATAL(DCM_dcmtlsGetLogger(), msg) 56 enum DcmCertificateVerification
60 DCV_requireCertificate,
193 void seedPRNG(
const char *randFile);
OFBool checkPrivateKeyMatchesCertificate()
checks if the private key and the certificate set using setPrivateKeyFile() and setCertificateFile() ...
void setPrivateKeyPasswdFromConsole()
sets the password string to be used when loading an encrypted private key file to be read from the co...
OFBool setTempDHParameters(const char *filename)
loads a set of Diffie-Hellman parameters from file.
this class represents a TCP/IP based transport connection which can be a transparent TCP/IP socket co...
void seedPRNG(const char *randFile)
adds the contents of a file to the seed for the cryptographic pseudo-random number generator...
factory class which creates transport layer connections.
DcmTLSTransportLayer & operator=(const DcmTLSTransportLayer &)
private undefined assignment operator
static const char * getOpenSSLCipherSuiteName(unsigned long idx)
returns a ciphersuite name in OpenSSL form
virtual DcmTransportConnection * createConnection(int openSocket, OFBool useSecureLayer)
factory method that returns a new transport connection for the given socket.
OFBool canWriteRandomSeed()
checks if enough entropy data is available to write back a modified random seed file.
void setPrivateKeyPasswd(const char *thePasswd)
sets the password string to be used when loading an encrypted private key file.
void addPRNGseed(void *buf, size_t bufSize)
modifies the PRNG by adding random data from the given buffer to the PRNG state.
factory class which creates secure TLS transport layer connections and maintains the parameters commo...
DcmTLSTransportLayer(int networkRole, const char *randFile)
constructor.
OFBool canWriteRandseed
true if there is enough random data to write a new random seed file
virtual ~DcmTLSTransportLayer()
destructor
DcmTransportLayerStatus addTrustedCertificateFile(const char *fileName, int fileType)
loads a certificate from a file and adds it to the pool of trusted certificates.
DcmTransportLayerStatus addTrustedCertificateDir(const char *pathName, int fileType)
loads all files as certificates from the specified directory and adds them to the pool of trusted cer...
DcmTransportLayerStatus setPrivateKeyFile(const char *fileName, int fileType)
loads the private key used for authentication of this application from a file.
static const char * getTLSCipherSuiteName(unsigned long idx)
returns a ciphersuite name in RFC 2246 (TLS) form
static OFString dumpX509Certificate(X509 *peerCertificate)
gets the most important attributes of the given X.509 certificate.
static const char * findOpenSSLCipherSuiteName(const char *tlsCipherSuiteName)
finds the OpenSSL ciphersuite name for a given RFC 2246 ciphersuite name.
static unsigned long getNumberOfCipherSuites()
returns the number of known ciphersuites.
simple wrapper around the "low-level" Logger object to make it easier to switch to a different system...
DcmTransportLayerStatus setCipherSuites(const char *suites)
sets the list of ciphersuites to negotiate.
a simple string class that implements a subset of std::string.
DcmTransportLayerStatus setCertificateFile(const char *fileName, int fileType)
loads the certificate (public key) used for authentication of this application from a file...
void setCertificateVerification(DcmCertificateVerification vtype)
defines how peer certificates should be treated when negotiating a TLS connection.
OFString privateKeyPasswd
contains the password for the private key if set on command line
SSL_CTX * transportLayerContext
OpenSSL context data, needed only once per application.
OFBool writeRandomSeed(const char *randFile)
writes a modified random seed to file.