From 159d1fb69a57dfe50cafdbc9af1b9e99548e24f7 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 15 Jan 2014 22:36:04 +0100 Subject: [PATCH] Style fixes, build fix with OpenSSL disabled. --- src/kits/network/libnetapi/Certificate.cpp | 52 +++++++++++++++++++++ src/kits/network/libnetapi/FileRequest.cpp | 3 +- src/kits/network/libnetapi/Jamfile | 5 +- src/kits/network/libnetapi/SecureSocket.cpp | 3 +- 4 files changed, 57 insertions(+), 6 deletions(-) diff --git a/src/kits/network/libnetapi/Certificate.cpp b/src/kits/network/libnetapi/Certificate.cpp index d11f24e8c2..3f711a80f7 100644 --- a/src/kits/network/libnetapi/Certificate.cpp +++ b/src/kits/network/libnetapi/Certificate.cpp @@ -11,6 +11,9 @@ #include "CertificatePrivate.h" +#ifdef OPENSSL_ENABLED + + static time_t parse_ASN1(ASN1_GENERALIZEDTIME *asn1) { // Get the raw string data out of the ASN1 container. It looks like this: @@ -103,3 +106,52 @@ BCertificate::Private::Private(X509* data) : fX509(data) { } + +#else + + +BCertificate::BCertificate(Private* data) +{ +} + + +BCertificate::~BCertificate() +{ +} + + +BString +BCertificate::String() +{ + return BString(); +} + + +bigtime_t +BCertificate::StartDate() +{ + return B_NOT_SUPPORTED; +} + + +bigtime_t +BCertificate::ExpirationDate() +{ + return B_NOT_SUPPORTED; +} + + +BString +BCertificate::Issuer() +{ + return BString(); +} + + +BString +BCertificate::Subject() +{ +} + + +#endif diff --git a/src/kits/network/libnetapi/FileRequest.cpp b/src/kits/network/libnetapi/FileRequest.cpp index 162af3dff3..28aa1db8c4 100644 --- a/src/kits/network/libnetapi/FileRequest.cpp +++ b/src/kits/network/libnetapi/FileRequest.cpp @@ -43,8 +43,7 @@ status_t BFileRequest::_ProtocolLoop() { BNode node(fUrl.Path().String()); - if (node.IsSymLink()) - { + if (node.IsSymLink()) { // Traverse the symlink and start over BEntry entry(fUrl.Path().String(), true); node = BNode(&entry); diff --git a/src/kits/network/libnetapi/Jamfile b/src/kits/network/libnetapi/Jamfile index a5e06deed1..b91385ecd0 100644 --- a/src/kits/network/libnetapi/Jamfile +++ b/src/kits/network/libnetapi/Jamfile @@ -14,10 +14,10 @@ for architectureObject in [ MultiArchSubDirSetup ] { if [ FIsBuildFeatureEnabled openssl ] { SubDirC++Flags -DOPENSSL_ENABLED ; UseBuildFeatureHeaders openssl ; - sslSources = SSL.cpp Certificate.cpp ; + sslSources = SSL.cpp ; md5Sources = ; Includes [ FGristFiles $(sslSources) SecureSocket.cpp - HttpAuthentication.cpp ] + HttpAuthentication.cpp Certificate.cpp ] : [ BuildFeatureAttribute openssl : headers ] ; # Dependency needed to trigger downloading/unzipping the package before # compiling the files. @@ -37,6 +37,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { NetDebug.cpp $(sslSources) + Certificate.cpp NetworkAddress.cpp NetworkAddressResolver.cpp diff --git a/src/kits/network/libnetapi/SecureSocket.cpp b/src/kits/network/libnetapi/SecureSocket.cpp index 3e9727e229..b2979d7460 100644 --- a/src/kits/network/libnetapi/SecureSocket.cpp +++ b/src/kits/network/libnetapi/SecureSocket.cpp @@ -174,8 +174,7 @@ BSecureSocket::Connect(const BNetworkAddress& peer, bigtime_t timeout) TRACE("SSLConnection can't connect\n"); BSocket::Disconnect(); - switch(SSL_get_error(fPrivate->fSSL, sslStatus)) - { + switch (SSL_get_error(fPrivate->fSSL, sslStatus)) { case SSL_ERROR_NONE: // Shouldn't happen... return B_NO_ERROR;