aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/gpio-button-hotplug/src
Commit message (Expand)AuthorAgeFilesLines
* gpio-button-hotplug: leave platform_device.dev.platform_data untouchedFurong Xu2017-08-211-2/+1
* gpio-button-hotplug: add more buttonsMathias Kresin2016-11-271-15/+24
* treewide: replace nbd@openwrt.org with nbd@nbd.nameFelix Fietkau2016-06-071-3/+3
* kernel: gpio-button-hotplug: Add missing ONESHOT flag to threaded IRQ requestJohn Crispin2016-03-031-1/+1
* kernel: gpio-button-hotplug: update to use threaded irq'sJohn Crispin2016-02-121-8/+5
* gpio-button-hotplug: handle EPROBE_DEFER and other errorsHauke Mehrtens2015-07-261-5/+15
* gpio-button-hotplug: remove #ifdef CONFIG_HOTPLUG, it is gone in newer kernel...Felix Fietkau2014-05-231-7/+0
* gpio-button-hotplug: add wwan buttonHauke Mehrtens2014-01-141-0/+1
* gpio-button-hotplug: fix crash on removeJonas Gorski2013-12-171-1/+1
* gpio-button-hotplug: add irq mode to driverJohn Crispin2013-12-091-94/+176
* gpio-button-hotplug: add support for sliding switchesJohn Crispin2013-11-111-12/+8
* gpio-button-hotplug: add support for power buttonsJohn Crispin2013-10-281-0/+1
* gpio-button-hotplug: debounce the initial button state, the first reads at bo...Felix Fietkau2013-08-051-2/+4
* gpio-button-hotplug: cleanup, fix compiler warningFelix Fietkau2013-08-031-4/+2
* gpio-button-hotplug: fix active_low handling, possibly broken in r37643Felix Fietkau2013-08-031-8/+9
* gpio-button-hotplug: use gpio_button_get_value() to initialize last_state.John Crispin2013-08-011-1/+1
* gpio-button-hotplug: use gpio_button_get_value() to fetch state.John Crispin2013-08-011-4/+1
* gpio-button-hotplug: add inline function gpio_button_get_value().John Crispin2013-08-011-0/+9
* gpio-button-hotplug: add support for EV_SWLuka Perkov2013-07-021-7/+21
* gpio-button-hotplug: improve gpio button debouncing, verify state changes ove...Felix Fietkau2013-06-291-6/+8
* packages: clean up the package folderJohn Crispin2013-06-212-0/+565
1">// contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. // =================================================================== // // crypto.c // // This file will handle all the TPM Crypto functionality // // ================================================================== #include <string.h> #include <openssl/crypto.h> #include <openssl/err.h> #include <openssl/evp.h> #include <openssl/rand.h> #include "crypto.h" #include "log.h" /** * Initialize cryptography library * @rand: random seed * @size: size of @rand */ void Crypto_Init(const BYTE* rand, int size) { ERR_load_crypto_strings(); CRYPTO_malloc_init(); OpenSSL_add_all_algorithms(); SYM_CIPHER = EVP_aes_128_cbc(); RAND_poll(); if (rand == NULL) return; RAND_add(rand, size, size); } /** * Shutdown cryptography library */ void Crypto_Exit() { ERR_free_strings(); ERR_remove_state(0); EVP_cleanup(); } /** * Get random data * @data: (OUT) Random data * @size: Size of @data */ void Crypto_GetRandom(void* data, int size) { int result; result = RAND_pseudo_bytes((BYTE*) data, size); if (result <= 0) vtpmlogerror (VTPM_LOG_CRYPTO, "RAND_pseudo_bytes failed: %s\n", ERR_error_string (ERR_get_error(), NULL)); }