blob: 21d2d96f4d23ed7a2733118e3235c7087d640d22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022 Eneas Ulir de Queiroz
include $(TOPDIR)/rules.mk
PKG_NAME:=uencrypt
PKG_RELEASE:=4
PKG_LICENSE:=GPL-2.0-or-later
PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz@gmail.com>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
CMAKE_INSTALL:=1
ifeq ($(BUILD_VARIANT),mbedtls)
CMAKE_OPTIONS+=-DUSE_MBEDTLS=1
else ifeq ($(BUILD_VARIANT),wolfssl)
CMAKE_OPTIONS+=-DUSE_WOLFSSL=1
endif
define Package/uencrypt/default
SECTION:=utils
CATEGORY:=Base system
TITLE:=Small Decryption utility
endef
define Package/uencrypt/default/description
This is a small encrypton/decryption program. It defaults
to AES-128-CBC, but supports any encryption provided by
the crypto library. Even though it can be used for
non-critical* regular encryption and decryption operations,
it is included here to unencrypt the configuration from mtd
on some devices.
* Key and IV are exposed on cmdline
This variant uses $(1) as crypto provider
endef
define Package/uencrypt-mbedtls
$(Package/uencrypt/default)
VARIANT:=mbedtls
TITLE+= using mbedTLS
DEPENDS:=+libmbedtls
CONFLICTS:=uencrypt-openssl uencrypt-wolfssl
endef
Package/uencrypt-mbedtls/description= \
$(call Package/uencrypt/default/description,mbedTLS)
define Package/uencrypt-openssl
$(Package/uencrypt/default)
VARIANT:=openssl
TITLE+= using OpenSSL
DEPENDS:=+libopenssl
CONFLICTS:=uencrypt-wolfssl
endef
Package/uencrypt-openssl/description= \
$(call Package/uencrypt/default/description,OpenSSL)
define Package/uencrypt-wolfssl
$(Package/uencrypt/default)
VARIANT:=wolfssl
TITLE+= using wolfSSL
DEPENDS:=+libwolfssl
endef
Package/uencrypt-wolfssl/description= \
$(call Package/uencrypt/default/description,wolfSSL)
define Package/uencrypt/default/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uencrypt $(1)/usr/bin
endef
Package/uencrypt-openssl/install = $(Package/uencrypt/default/install)
Package/uencrypt-wolfssl/install = $(Package/uencrypt/default/install)
Package/uencrypt-mbedtls/install = $(Package/uencrypt/default/install)
$(eval $(call BuildPackage,uencrypt-mbedtls))
$(eval $(call BuildPackage,uencrypt-openssl))
$(eval $(call BuildPackage,uencrypt-wolfssl))
|