2022-07-08 14:08:21 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2022 Eneas Ulir de Queiroz
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=uencrypt
|
2023-02-17 11:12:40 +00:00
|
|
|
PKG_RELEASE:=4
|
2022-07-08 14:08:21 +00:00
|
|
|
|
|
|
|
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
|
2023-02-17 11:12:40 +00:00
|
|
|
ifeq ($(BUILD_VARIANT),mbedtls)
|
|
|
|
CMAKE_OPTIONS+=-DUSE_MBEDTLS=1
|
|
|
|
else ifeq ($(BUILD_VARIANT),wolfssl)
|
|
|
|
CMAKE_OPTIONS+=-DUSE_WOLFSSL=1
|
|
|
|
endif
|
2022-07-08 14:08:21 +00:00
|
|
|
|
2023-02-17 11:12:40 +00:00
|
|
|
define Package/uencrypt/default
|
2022-07-08 14:08:21 +00:00
|
|
|
SECTION:=utils
|
|
|
|
CATEGORY:=Base system
|
2023-02-17 11:12:40 +00:00
|
|
|
TITLE:=Small Decryption utility
|
2022-07-08 14:08:21 +00:00
|
|
|
endef
|
|
|
|
|
2023-02-17 11:12:40 +00:00
|
|
|
define Package/uencrypt/default/description
|
2022-08-13 15:23:58 +00:00
|
|
|
This is a small encrypton/decryption program. It defaults
|
|
|
|
to AES-128-CBC, but supports any encryption provided by
|
2023-02-17 11:12:40 +00:00
|
|
|
the crypto library. Even though it can be used for
|
|
|
|
non-critical* regular encryption and decryption operations,
|
2022-08-13 15:23:58 +00:00
|
|
|
it is included here to unencrypt the configuration from mtd
|
2023-02-17 11:12:40 +00:00
|
|
|
on some devices.
|
|
|
|
|
|
|
|
* Key and IV are exposed on cmdline
|
|
|
|
|
|
|
|
This variant uses $(1) as crypto provider
|
2022-07-08 14:08:21 +00:00
|
|
|
endef
|
|
|
|
|
2023-02-17 11:12:40 +00:00
|
|
|
define Package/uencrypt-mbedtls
|
|
|
|
$(Package/uencrypt/default)
|
|
|
|
VARIANT:=mbedtls
|
|
|
|
TITLE+= using mbedTLS
|
|
|
|
DEPENDS:=+libmbedtls
|
|
|
|
CONFLICTS:=uencrypt-openssl uencrypt-wolfssl
|
|
|
|
endef
|
2022-07-08 14:08:21 +00:00
|
|
|
|
2023-02-17 11:12:40 +00:00
|
|
|
Package/uencrypt-mbedtls/description= \
|
|
|
|
$(call Package/uencrypt/default/description,mbedTLS)
|
2022-07-08 14:08:21 +00:00
|
|
|
|
2023-02-17 11:12:40 +00:00
|
|
|
define Package/uencrypt-openssl
|
|
|
|
$(Package/uencrypt/default)
|
|
|
|
VARIANT:=openssl
|
|
|
|
TITLE+= using OpenSSL
|
|
|
|
DEPENDS:=+libopenssl
|
|
|
|
CONFLICTS:=uencrypt-wolfssl
|
2022-07-08 14:08:21 +00:00
|
|
|
endef
|
|
|
|
|
2023-02-17 11:12:40 +00:00
|
|
|
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
|
2022-07-08 14:08:21 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uencrypt $(1)/usr/bin
|
|
|
|
endef
|
2023-02-17 11:12:40 +00:00
|
|
|
Package/uencrypt-openssl/install = $(Package/uencrypt/default/install)
|
|
|
|
Package/uencrypt-wolfssl/install = $(Package/uencrypt/default/install)
|
|
|
|
Package/uencrypt-mbedtls/install = $(Package/uencrypt/default/install)
|
2022-07-08 14:08:21 +00:00
|
|
|
|
2023-02-17 11:12:40 +00:00
|
|
|
$(eval $(call BuildPackage,uencrypt-mbedtls))
|
|
|
|
$(eval $(call BuildPackage,uencrypt-openssl))
|
|
|
|
$(eval $(call BuildPackage,uencrypt-wolfssl))
|