summaryrefslogtreecommitdiff
path: root/src/state/activating_state.cpp
AgeCommit message (Collapse)AuthorFilesLines
2022-03-15Make mount/unmount dbus calls asynchronousPrzemyslaw Czarnowski1-1/+2
Change the default behavior of mount/umount dbus calls from blocking to unblocking ones. Once mount/unmount is triggered, appropriate action is running in the background moving handling of operation result to async event. At the end of processing dbus completion signal is sent to client with uint value of operation status (identical with errno code). Tested: Manual scheduling of mount and unmount operations with monitoring dbus communication of virtual-media service - matching api calls with completion signal. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2022-02-14Switch the build system to mesonPrzemyslaw Czarnowski1-26/+21
Due to requirements from community, new projects have to be built with meson. To unify with other projects some additional warnings has been enabled, so appropriate code updates has been implemented. This commit makes both meson and CMake available to simplyfy transition in openbmc. CMake support will be removed after switching to meson in openbmc will be accepted. Tested: Compiled and smoke tested. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2022-01-26Add -Wextra, remove warnings (#1)Przemyslaw Czarnowski1-9/+10
Removed all -Wextra warnings in VM sources. -Wno-unused-parameter has to be disabled due to lots of such warnings in sdbusplus. Tested: Compilation generates no warnings Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2021-08-27Override default libcurl CAInfo with empty string.Golgowski, Wiktor1-13/+13
This change allows virtual-media to pass a zero-length string to nbdkit curl plugin cainfo parameter, which will allow for capath to be used. Tested: Manually, with Virtual-Media HTTPS test in ATF. Change-Id: I14ffa2ecbb2bd6cadee3bb8929ef2e1b8bbbf157 Signed-off-by: Golgowski, Wiktor <wiktor.golgowski@intel.com>
2021-08-25Restricted TLS cipher suites to preferred onesKarol Niczyj1-4/+5
Updated TLS 1.2 cipher list and added TLS1.3 cipher list. Tested by Oleksandr Shulzhenko on local setup. Change-Id: I218c245d8ddf7e54dae258a39cd78c3255027b6e Signed-off-by: Karol Niczyj <karol.niczyj@intel.com>
2021-05-25Forbid ECDHE-RSA-CHACHA20-POLY1305 with TLSv1.2Czarnowski, Przemyslaw1-1/+2
According to the latest recommendations obsolete cipher suites shall be forbidden. Tested: Python HTTP server configured TLSv1.2 with ECDHE-RSA-CHACHA20-POLY1305 cipher can't be reached. Change-Id: I370c125b28c4df4bba744ec63536aa8fdebb961d Signed-off-by: Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
2021-05-24Forbid redirection of https resourcesCzarnowski, Przemyslaw1-0/+1
Due to security reasons (by security researcher recommendation) remote source redirections shouldn't be allowed in order to disallow connection downgrading Tested: Tested with python server script forcing redirection Change-Id: Ia68884dbcc399abc685dcbcf4e205aa62356478f Signed-off-by: Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
2021-05-07Legacy HTTPs: Set minimum tls version to 1.2Czarnowski, Przemyslaw1-1/+1
Due to change of recommendation of minimum TLS version from 1.1 to 1.2, version passed to CURL plugin of Nbdkit is changed appropriately. Tested: Manually; TLSv1.1 server is rejected for Legacy/HTTPs. Change-Id: Ifc8848817deb9f73a44f551d85f1fe9ba20b3e10 Signed-off-by: Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
2021-05-06Change log level to InfoCzarnowski, Przemyslaw1-5/+5
Due to security reasons "user/username" has to be removed from the information that is logged by application. Sensitive data has been moved to "Debug"" level (lowest one) and default one has moved one level up to "Info". Also some important information allowing to catch basic errors has been upgraded to "Info". Tested: Manually, mounting both Legacy mode remote types (HTTPs and CIFS) and checking if journal for VirtualMedia service does not contain sensitive information. Change-Id: Ie6c3a79c94637e3632af76daf957e986b2dd3b6d Signed-off-by: Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
2021-04-27Image mount fails if socket directory not presentAnna Platash1-0/+31
When trying to mount virtual media image in Legacy mode nbd tries to create unix socket and if the parent directory does not exist mount fails. Also used noexcept versions of filesystem operations. Tested: Locally, by manually removing the socket's parent folder and mounting an image in Legacy mode (Samba). Change-Id: If5beb7add655e09a60511b30e4edbd34c8c15ec5 Signed-off-by: Anna Platash <anna.platash@intel.com> Signed-off-by: Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
2020-12-15Remove unsuported cipher suits form legacy HTTPSKarol Wachowski1-1/+4
Removed following cipher suits: * AES256-GCM-SHA384 * AES128-GCM-SHA256 * AES256-SHA256 * AES128-SHA256 Tested: - verified manually that listed ciphers are not accepted - verified manually that it is possible to mount HTTPS resource using TLS version >= 1.1 and other ciphers Change-Id: If41dfc8fa8439a1be1fd61dbb639595523a7157d Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
2020-10-02Add requirement for TLSv1.1 for VM legacy mode.Golgowski, Wiktor1-1/+2
This change adds nbdkit curl plugin parameters for specifying TLS version. VM is configured to support TLSv1.1 or greater. Tested: manually, TLSv1.0 is not negotiated during connection. Change-Id: I0d1186534ba3ec2f7937fea65c0cc1f01557cf6e Signed-off-by: Golgowski, Wiktor <wiktor.golgowski@intel.com>
2020-09-30Revert "Add TLS version and cipher suites to legacy HTTPS."Feist, James1-6/+1
This reverts commit b253675eb507f07f8072b287c0ea68448808eb0b. Change-Id: I29c2eb73ecc37e47c4dd44b668c6d9a1ab2f6579 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-09-23Add TLS version and cipher suites to legacy HTTPS.Golgowski, Wiktor1-3/+8
This change adds nbdkit curl plugin parameters for specifying TLS version and not allowed cipher suites (OWASP recommendation). Tested: manually, TLSv1.0 is not negotiated during connection. Awaiting confirmation for cipher suites. Warning: this change may break legacy mode, if used with nbdkit without ssl-version and ssl-cipher-list (see review #272350). Change-Id: I06c5acc7a87de6c1bd1b0cdcef2af8585a3da965 Signed-off-by: Golgowski, Wiktor <wiktor.golgowski@intel.com>
2020-07-21VirtualMedia add Mount/Unmount timeout handlingKarol Wachowski1-13/+4
Added Timeout dbus property for block devices in VirtualMedia. Added throwing EBUSY exception when Mount/Unmount operation times out. Added transition from ActivatingState to DeactivatingState. Tested: Verified that after mounting non-existing HTTPS resource in proxy mode, VirtualMedia recovers restoring ready state and throws EBUSY during that transition. Verfied that resources can be mounter/unmounted in both legacy and proxy mode. Change-Id: I3768af13663046cc55976ad59062f8bc1d6396ba Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
2020-07-20Provide nbdkit with path to CA certificatesCzarnowski, Przemyslaw1-1/+3
OpenBMC uses custom path for certificates: /etc/ssl/certs not /usr/lib/ssl/certs like curl plugin default. We need to provide it in order to make curl plugin work in OpenBMC environment. Tested: Certificate Authority added with UI allows to use https server signed with this certificate. Change-Id: I702179862e9e977efd162bdf19426208c4ce45f0 Signed-off-by: Czarnowski, Przemyslaw <przemyslaw.hawrylewicz.czarnowski@intel.com>
2020-07-17Fixing multiple problems with state machine in virtual mediaKrzysztof Grobelny1-0/+336
- Previously machine did not handle AnyEvent correctly, implementation in BaseState was always run - Changing from ActiveState to ReadyState was bugged, previously only one of event SubprocessStopped or UdevNotification caused state change when it is required to wait for both - Introduced longer timer when waiting for ReadyState during Eject and ActiveState during Inject, because ndbkit can timeout during Eject and it is required to complete before next inject can success. - Added event notification when process is terminated - Added resourcess classes to handle deletion and notifications Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com> Signed-off-by: Karol Wachowski <karol.wachowski@intel.com> Change-Id: Ie914e650c2f15bd73cdc87582ea77a94997a3472 Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>