summaryrefslogtreecommitdiff
path: root/http
AgeCommit message (Collapse)AuthorFilesLines
2020-05-28Redfish:Dump offload handler implementation using nbd-proxyraviteja-b2-1/+17
This handler transfers data between nbd-client and nbd-server. basically it invokes nbd-proxy and reads data from socket and writes on to nbd-client and vice-versa Change-Id: I429393a5e056647333bf4e148c0df2a5695b2a47 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
2020-05-20Implement Redfish PasswordChangeRequiredJoseph Reynolds1-0/+65
This implements the Redfish PasswordChangeRequired handling. See section 13.3.7.1 "Password change required handling" in the 1.9.1 spec: https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.9.1.pdf These portions of the spec are implemented: - Authenticatation with a correct but expired password creates a session: - The session is restricted to the ConfigureSelf privilege which allows a user to change their own password (via GET and PATCH Password for their own account). Support for the ConfigureSelf privilege is already in BMCWeb. - The session object has the PasswordChangeRequired message. - All other operations respond with http status code 403 Forbidden and include the PasswordChangeRequired message. - The ManagerAccount (URI /redfish/v1/AccountService/Accounts/USER) PasswordChangeRequired property is implemented for local accounts but not present for remote accounts. This has the following additional behavior: The PasswordChangeRequired property is updated at the start of each new REST operation, even within an existing session. This behavior implements a "dynamic" PasswordChangeRequired handling that responds to changes to the underlying "password expired" status. Specifically: - Sessions restricted by the PasswordChangeRequired handling lose that restriction when the underlying account password is changed. - Sessions become subject to the PasswordChangeRequired handling restrictions whenever the underlying account password expires. - The mechanism is to check if the password is expired at the start of every new REST API operation, effectively updating the ManagerAccount PasswordChangeRequired property each time. This makes BMCWeb responsive to changes in the underlying account due to other activity on the BMC. Notes: 1. Note that when an account password status is changed (for example, the password becomes expired or is changed) and that account has active sessions, those sessions remain. They are not deleted. Any current operations are allowed to complete. Subsequent operations with that session pick up the new password status. 2. This does not implement OWASP recommendations which call for sessions to be dropped when there is a significant change to the underlying account. For example, when the password is changed, the password becomes expired, or when the account's Role changes. OWASP's recommendation is due to the session fixation vulnerability. See the OWASP Session Management Cheat Sheet section "Renew the Session ID After Any Privilege Level Change": https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#renew-the-session-id-after-any-privilege-level-change BMCWeb protects against session fixation vulnerabilities because it always regenerates new session IDs when successful authentication creates a new session. 3. Users authenticating via mTLS are not subject to the PasswordChangeRequired behavior because mTLS takes precedence over password-based authentication. Tested: 0. Setup: - The `passwd --expire USERNAME` command was used to expire passwords. The `chage USER` command was also used. - The following were used to change the password: Redfish API, passwd command, and the SSH password change dialog. - Tested the following via Basic Auth, /login, and Redfish login (except where Basic Auth does not create a persistent session). - Only local user account were tested. - Did not test authentication via mTLS or with LDAP users. 1. When the password is not expired, authentication behaves as usual for both correct and incorrect passwords. 2. When the password is incorrect and expired, authentication fails as usual. 3. When the password is correct but expired: A. A session is created and has the PasswordChangeRequired message. B. That session cannot access resources that require Login privilege and the 403 message contains the PasswordChangeRequired message. C. That session can be used to GET the user's account, PATCH the Password, and DELETE the session object. D. The account PasswordChangeRequired reports true. 4. While a session is established, try expiring and changing (unexpiring) the password using various mechanisms. Ensure both the session object and the ManagerAccount PasswordChangeRequired property report the correct condition, and ensure PasswordChangeRequired handling (restricting operations to ConfigureSelf when PasswordChangeRequired is true) is applied correctly. Signed-off-by: Joseph Reynolds <joseph-reynolds@charter.net> Change-Id: Iedc61dea8f949e4b182e14dc189de02d1f74d3e8
2020-05-13Fix incorrect decoding of query stringChanyoung Park1-1/+1
QueryString class decodes incorrectly when it encounters percent-encoded query strings "%xy", and cause the http request class to have wrong query parameters. Fixed a bug in the process of converting 2-digit hexadecimal number to a single byte. Tested: - Generate requests contains percent-encoded query strings - Check the urlParams field in crow::Request class and it works as expected Example: - Before: GET https://{bmc}/...?a=b%20c&d=e req->urlParams: [ a=b, d=e ] - After: GET https://{bmc}/...?a=b%20c&d=e req->urlParams: [ a=b c, d=e ] Signed-off-by: Chanyoung Park <park910113@gmail.com> Change-Id: Ic1bfc74bbf4882e55445dba246ca769699fab332
2020-05-02EventService: Queuing the request data and retryAppaRao Puli1-55/+175
Add support to queue the request event data. Maintaining the proper state of connection and retry for appropriate action depending on state. If max retries are reached then suspend the retries. Need to add async timeout between retries and take action as configured 'DeliveryRetryPolicy' by user. Tested: - Using Telemetry reports, streamed data to validate the queue by stopping listener. - Verified the retry logic. - Verfiied the appropriate action depending failed state of connection. Change-Id: Idd562cd512897625bf7b0d9a376207db5cb8642f Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-04-21Http client supportAppaRao Puli1-0/+190
Add Http client support to asynchronously open the TCP connection with client and send data(POST only). This doesn't have support to keep open connection alive and also re-attempt send message during fail cases. Tested: - Able to push data to HTTP server successfully. Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: I2c1abf8ac4b002278377761d2dbc8b563808efcb
2020-04-15Add CSRF check into websocketsJames Feist1-2/+15
This adds CSRF check into websockets to avoid attacks on websockets. Tested: Could no longer use crosssite scripting to open websocket. KVM and SOL still work once web-ui changes are updated Change-Id: I325079ae3d4db2701671564dff733e034d2670d6 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-04-08Protect against timer exhaustionJames Feist2-3/+14
Currently there is no check to see if all timers are used. This adds a check so that under many connections we don't get a double free. Tested: Spun up many connections and double free went away Change-Id: I7c6914f566064c57ad28d3bfe79a53e44f598a35 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-03-31Protect against slow read attackJames Feist2-24/+33
Right now as long as an attacker continutes to do a slow read, the connection will stay open forever. Set a timeout so this can't happen. Tested: Used slowhttptest to verify this wouldn't happen Change-Id: I4dbe2a18f9ccce0ba36875572ec3df6bf3be6a1e Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-03-31Fix for possible memory leak in mTLS.Zbigniew Kurzynski1-0/+2
Freeing resources returned by X509_get_ext_d2i method. Tested: Manual test were made to verify if TLS authentication works as before. Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com> Change-Id: I937d7a13b9b63501fd58b846e6050c5523f76cc4
2020-03-17Task: Add payload supportJames Feist1-1/+2
This adds the payload values to task responses. Tested: passed validator Change-Id: I50467e28ce8142d198f916ea0c63bd413edcd524 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-03-05Permission check for virtual media proxy modePrzemyslaw Czarnowski1-1/+10
This patch enables checking of user permission for proxy mode, as start of this kind service is not triggered by redfish (which has permission check by default). Permission check is done in .onopen handler of websocket. For this reason another dbus call for user privileges is added to verify if user has "ConfigureManager" privilege. I have chosen this approach, as generic privilege check for all websockets introduces significant changes in connection upgrade flow which makes implementaion vague and caused some memory issues difficult to track down. It is worth noting that other websockets (eg. kvm) uses .required() function to set privilege but this information is lost during connection upgrade and is not checked anywhere in upgrade flow. Tested: Manual tests with opening websockets via web browser and dedicated nbd proxy utility. For users with/without appropriate permissions. Single request and burst of requests has been tested as well. Change-Id: I2a56bec606fa0e5f3d4232e48794c9055bf6095e Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2020-02-14Fix off by 1 errorJames Feist1-3/+1
i can increment > qs_kv_size with some inputs. Fix this by incrementing earlier in the loop instead so we don't have to increment after the loop and possibly go past max. Tested: Used bad string and no longer saw segfault Change-Id: Ia68cd9b24e9a0b16646197983c513d78df2239ed Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-01-09Fix timeout issue during image uploadJan Sowinski2-14/+31
This commit fixes timeout issues when transfering bigger payloads like update image. Tested by uploading image: curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" \ -X POST -T test.tar https://$bmc/upload/image # slow connection upload (~10kB/s) curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" \ -X POST -T test.tar https://$bmc/upload/image --limit-rate 10k Signed-off-by: Jan Sowinski <jan.sowinski@intel.com> Change-Id: I913136013afb58c97071819288460f4cb64d0d83
2020-01-09Revert "Revert "Connection and websockets fixes""Jan Sowinski4-83/+70
This reverts commit a8086647b103f55116ce4c872e1455ebf1f3e346. Reason for revert: Restoring commit c00500b as base for upload image issue fix Change-Id: I1dd5d3fda2d1ee6f4027193a0506d5ca764b01e4 Signed-off-by: Jan Sowinski <jan.sowinski@intel.com>
2020-01-08Revert "Connection and websockets fixes"James Feist4-70/+83
This reverts commit c00500bcb9c5145f5cacb78bbe3dd694fb85ba0a. Reason: Makes image upload fail Tested: Image upload works again requests.post( 'https://{}/redfish/v1/UpdateService'.format(args.address), data=file.read(), verify=False, auth=(args.username, args.password)) Change-Id: Iaf780d052d98accdead32e87f468002f5141b19a Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-12-19Make the max http request body size configurableAdriana Kobylak1-4/+8
OpenBMC supports "System" or "bundled" images that contain two or more firmware images, such as BMC and Host or PSU firmware, making the resulting image file greater than the current limit of 30MB. Make the http request body size configurable to allow bigger files to be uploaded. Tested: - Upload a regular BMC image still works. - Uploading a 50MB firmware image that contains the host fw fails: $ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T obmc-phosphor-image-witherspoon-128.ubi.mtd.tar https://${bmc}/upload/image curl: (52) Empty reply from server - With the "-DBMCWEB_HTTP_REQ_BODY_LIMIT_MB=128" compile option works: $ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T obmc-phosphor-image-witherspoon-128.ubi.mtd.tar https://${bmc}/upload/image { "data": "19e6fe13", "message": "200 OK", "status": "ok" } Change-Id: I0b0e1032c9daf00a01e42ac5ee1c0d979f857d5e Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2019-12-19Connection and websockets fixesJan Sowinski4-83/+70
This commit fixes issue around Connection class and websockets - controlling connection lifetime by shared_ptr instead of manual new/delete - fixed memory leak when upgrading connection to websockets - removed dangling reference to conn.req in websockets - fixed lack of reponse for invalid websockets URLs - fixed not working connections deadline timer There is no noticable performance impact after switching connection management to shared pointers. Benchmark results using: wrk https://${bmc} shared_ptr: 144.29 Requests/sec new/delete: 144.41 Requests/sec Tested manually: performance: wrk https://${bmc} memory leaks: top websockets: webui- KVM and VirtualMedia HTTP GET on random Redfish schemas: postman Signed-off-by: Jan Sowinski <jan.sowinski@intel.com> Change-Id: I63f7395ba081a68e7900eae2ed204acd50f58689
2019-12-19Turning ON the mutual TLSZbigniew Kurzynski1-1/+1
This commit sets the mutual TLS option to ON by default. Core mTLS implementation was accepted under this commit: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/23588 where by default the mTLS was disabled. Tested: Manual tests were made to verify if this option turns the mTLS ON. Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com> Change-Id: I3bc5f5453d4c4df1cd7ecb0b8868423285b6ab83
2019-12-19Implement a TODO(ed) in commentEd Tanous1-1/+0
I now understand the router properly (as I did a while back). This call is correct, as "/" and "" are considered the same by the router. Tested: Comment change, no impact to code. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Ic6fc17f0e7137bbc3674c2290d10dcdba9b4ed18
2019-12-17Consolidate regex calls when converting linksJason M. Bills1-12/+5
We currently use multiple regex calls to convert specific fields to links. Rather than continuing to add new regex calls for individual link types, we can use one regex to convert all '/redfish/' paths to links. Tested: Checked that all provided redfish paths are converted to links: odata.id, odata.context, nextLink, Uri, etc. Change-Id: I2f06e2d5ee9b3d88141f1629f168b3667669d93f Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-12-17Fix authorization for LDAP usersRAJESWARAN THILLAIGOVINDAN3-39/+54
Modified the code to make an asynchronous call to GetUserInfo to get the user role for authorization. For local users, DBus matches are used to store user role map hot in memory. Hence, bmcweb has to know whether a user is a local user or LDAP user to get the role. To avoid this, removed the existing DBus matches and modified the code to call GetUserInfo to get the role of local users as well as LDAP users. Tested: - Created a local user having admin privilege and verified that he is able to restart the system /redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' - Created a local user having user privilege and verified that he is unauthorized to restart the system /redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' - Created a remote user having admin privilege and verified that he is able to restart the system /redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' - Created a remote user having user privilege and verified that he is unauthorized to restart the system /redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' - Tested Redfish ConfigureSelf privilege Signed-off-by: RAJESWARAN THILLAIGOVINDAN <rajeswgo@in.ibm.com> Change-Id: Ic3e46a0c0aff2cf456c98048350e58e302011c57
2019-12-16Adding a new value to cookieZbigniew Kurzynski1-1/+2
This new value will be used by javascript in phosphor-webui to perform login-less authentication. Tested: Manually tests were performed on Chrome browser. Having enabled and configured mTLS user is able to authenticate with proper certificates. The login page is not displayed unless user logs out. Appropriate phosphor-webui changes can be found here: https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-webui/+/27851 Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com> Change-Id: Iac76459e1843a5c8bd2287c6e078319aebedfdcc
2019-12-16Fixing mTLS switchesZbigniew Kurzynski1-5/+56
This commit is a fix for revert: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/27205 The mTLS will work only when: * Compilation flag BMCWEB_ENABLE_MUTUAL_TLS_AUTHENTICATION is enabled and, * AccountService->Oem->OpenBMC->AuthMethods->TLS is set and, * at least one certificate is uploaded to TrustStore. To enforce a new mTLS settings after switching AuthMethods->TLS all awaiting for acceptance connections are dropped. In case of authorized mTLS requests a cookie with XSRF-TOKEN entry and SESSION is added to response. It will force the X-XSRF-TOKEN challenge in case of applications supporting cookies like web browsers. Also some minor log messages changes were made in this commit. Tested: validator_service run with status: 'Validation has succeeded'. Tests were made with Chrome browser Version 78.0.3904.108. The certificate popup appears only when mTLS is enabled in CMake, the TLS option is set and at least one CA certificate is present. In other cases mTLS is not active and there is no popup for certs. Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com> Change-Id: I778b848b767356b60386694f802a89b3c1f6cb14
2019-12-10Revert "Fix authorization for LDAP users"James Feist1-48/+37
This reverts commit 5e931ae994307babe6c3520cbaca6a7139acc81d. Reason for revert: Causing build failures /bmcweb/redfish-core/include/node.hpp: In member function ‘bool redfish::Node::isAllowedWithoutConfigureSelf(const crow::Request&)’: /bmcweb/redfish-core/include/node.hpp:182:36: error: ‘crow::persistent_data::UserRoleMap’ has not been declared crow::persistent_data::UserRoleMap::getInstance().getUserRole( When 900f949773795141266271107219ea019f2839cd was merged first this patch was not successfully rebased. Change-Id: I947d96362c7dadea5572888468a11fac5ee361d4 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-12-09Fix authorization for LDAP usersRAJESWARAN THILLAIGOVINDAN1-37/+48
Modified the code to make an asynchronous call to GetUserInfo to get the user role for authorization. For local users, DBus matches are used to store user role map hot in memory. Hence, bmcweb has to know whether a user is a local user or LDAP user to get the role. To avoid this, removed the existing DBus matches and modified the code to call GetUserInfo to get the role of local users as well as LDAP users. Tested: - Created a local user having admin privilege and verified that he is able to restart the system /redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' - Created a local user having user privilege and verified that he is unauthorized to restart the system /redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' - Created a remote user having admin privilege and verified that he is able to restart the system /redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' - Created a remote user having user privilege and verified that he is unauthorized to restart the system /redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' Signed-off-by: RAJESWARAN THILLAIGOVINDAN <rajeswgo@in.ibm.com> Change-Id: Ifd813e1af4dfcb7aeaba18e04b6c9767d2a5e95a
2019-11-22Adding instance address to log formatting.Zbigniew Kurzynski1-119/+122
Some log messages were not following logging format used in this file, after this change logs from the http_connection.h file should be coherent. Also changing log level of one of messages in ‘doRead’ function. Tested: Manually, the bmcweb was build with logging enabled and tested by journalctl log verification. Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com> Change-Id: I6c96124cbc3b5ef96bfdca57f04c834728f52fe6
2019-11-21Implement nbd-proxy as a part of bmcwebIwona Klimaszewska2-12/+24
Nbd-proxy is responsible for exposing websocket endpoint in bmcweb. It matches WS endpoints with unix socket paths using configuration exposed on D-Bus by Virtual-Media. Virtual-Media is then notified about unix socket availability through mount/unmount D-Bus methods. Currently, this feature is disabled by default. Tested: Integrated with initial version of Virtual-Media. Change-Id: I9c572e9841b16785727e5676fea1bb63b0311c63 Signed-off-by: Iwona Klimaszewska <iwona.klimaszewska@intel.com> Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2019-11-19Implement constant time string compare for tokenEd Tanous1-0/+22
The sessions implementation previously used operator== for session comparisons. While unlikely to be attackable in the current implementation, due to the time smearing in a number of cases, modern security practices recommend using constant time comparison. Tested By: Logged into the webui, and observed no change to login flows. Logged into redfish using Token Auth, and observed no changes. Closed a previous session, then reopened with the new session information to verify user sessions are restored properly and still work. Change-Id: Ie759e4da67ba004fd8c327f177951ac756ea6799 Signed-off-by: Ed Tanous <ed.tanous@intel.com> Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-11-18mTLS access fix to some URLs.Zbigniew Lukwinski1-1/+1
This patch is about fixing mTLS access to URL requiring Administrator or Opeartor privileges (e.g. /redfish/v1/AccountService). Tested manually with cURL: - prepare and install CA certificate, - call GET to the url=/redfish/v1/AccountService, - verify whether got status=200 and proper body in the response. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com> Change-Id: I65109bffadf4f1d6d410cd303687b6da55fd1be0
2019-11-12TLS method configurationZbigniew Kurzynski1-0/+9
User is now able to turn on and off the TLS authentication method. Tested: No regression found in manual testing. By default everything works as before, and disabling TLS method prevents user to authenticate by it. Tested with Redfish Service Validator, version 1.2.8 Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com> Change-Id: Ib7be1af659db568caa7e5b97e3844617586d7754
2019-11-12Add a self check in the copy constructor for qsEd Tanous1-0/+5
clang-tidy has checks for bugprone constructs. In this case, self assignment is handled poorly by this object. There is nowhere in the code where we do this, but add the check anyway to silence the warning. Background: https://clang.llvm.org/extra/clang-tidy/checks/bugprone-unhandled-self-assignment.html Tested: clang-tidy now passes. Code still compiles. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I49b6d6e08165b23114a7f46f305523acfbb32241
2019-11-11Replace all uses of NULL with nullptrEd Tanous3-6/+6
This was an automatic change made by clang-tidy. It moves all uses of NULL to nullptr, which are equivalent, but nullptr is prefered. Tested: Code compiles. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I9526599b222693c9723a69934b599c7a5b5d1fbf
2019-11-11Fix modernize-use-bool-literalsEd Tanous1-1/+1
modernize-use-bool-literals flagged one violation in the code. Tested: No functional change. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iccfa7a88e7df0b7e7434fadd549c2f816c98a46e
2019-11-11Move default destructors to = default syntaxEd Tanous1-6/+2
Modern c++ prefers setting default destructors to =default Tested: clang-tidy modernize-use-equals-default now passes Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I9ca746473263abfe2330b7c3e2fe645cf96112f3 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-11-08TLS based user auth implementationKowalski, Kamil1-1/+155
Implemented TLS based user auth. It utilizes certificates stored by Phosphor Certificate Manager in storage mode, to verify that user that tries to log in, has a certificate signed by a trusted CA. More about this can be read in redfish-tls-user-authentication.md design document. Tested that it does not break current authentication methods, when not using TLS Auth - user should not see difference between versions. TLS Auth itself allows user in when certificate is signed by trusted CA and valid, and stops working immediatley after it is removed. User is not let in when provided certificate is not between notBefore and notAfter dates. Session is tested to not be created when user does not exist in the system (courtesy of earlier UserManagement usage commits). Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com> Change-Id: I6bcaff018fe3105f77d3c10f69765e0011af8dab Signed-off-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com>
2019-11-07Move some variables to constexprEd Tanous1-2/+2
clang-tidy flags these variables as having lifetime issues given that they point to compile time parameters, resolve the error: Tested: Code compiles, clang-tidy no longer returns an error on that line. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iaa0da0c346786a79a6e66877082c3716bcffdf69
2019-10-30Get rid of a nasty macroEd Tanous1-26/+56
Now that we have constexpr if, clean this check up a bit Tested: no functional change Change-Id: Ia3541b056a502b0136c89c7e543ddc0b708f722b Signed-off-by: Ed Tanous <ed.tanous@intel.com> Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-10-23Fix the websocket handshakeRatan Gupta1-3/+7
If bmcweb is compiled with NON SSL mode then HTTP/websocket connection upgrade was not happening This commit fixes this behavior TestedBy: Sent a websocket request in non secure mode and the websocket handshake was working ws://{ip}/vm/0/0 to verify this Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com> Change-Id: I33ca950cedf591f66f4d68514d48d3b9c9fec421
2019-10-23Prohibit making connection based on old CA cert.Zbigniew Lukwinski1-0/+8
This is fix for issue #107. Tested: Reproduction steps from #107 was followed. mTLS way of authentication was used. As a result connection try based on user certificate generated from already replaced CA certificate was dropped. Bmcweb didn't allow make such connection. Change-Id: I4709927b5fc108e5b26b7db1981ae77c6aa8a5bf Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2019-10-18Make references to crow less obviousEd Tanous14-0/+4637
Recently, a number of people in the community have made the (admittedly easy) mistake that we use a significant portion of crow. Today, we use crow for the router, and the "app" structure, and even those have been significantly modified to meet the bmc needs. All other components have been replaced with Boost beast. This commit removes the crow mentions from the Readme, and moves the crow folder to "http" to camouflage it a little. No code content has changed. Tested: Code compiles. No functional change made to any executable code. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iceb57b26306cc8bdcfc77f3874246338864fd118