aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2025-04-11 18:24:52 +0300
committerkaotisk <kaotisk@arching-kaos.org>2025-04-11 18:24:52 +0300
commitb9c719d094c3ac8a802b59d7667a97514d03faed (patch)
tree2aec9cdf65954bff7e6ef6aadbd2a465c6d445b2
parent2abc2c618f141b84640d527c5f834b58d1a76c44 (diff)
downloadarching-kaos-tools-b9c719d094c3ac8a802b59d7667a97514d03faed.tar.gz
arching-kaos-tools-b9c719d094c3ac8a802b59d7667a97514d03faed.tar.bz2
arching-kaos-tools-b9c719d094c3ac8a802b59d7667a97514d03faed.zip
-rwxr-xr-xlib/_ak_ns48
1 files changed, 19 insertions, 29 deletions
diff --git a/lib/_ak_ns b/lib/_ak_ns
index c391d51..683f572 100755
--- a/lib/_ak_ns
+++ b/lib/_ak_ns
@@ -59,6 +59,23 @@ function _ak_ns_list_long(){
_ak_gpg_list_secret_keys_long | grep '@keynames.kaos.kaos'
}
+function _ak_ns_resolve_from_key(){
+ # $1; exit;;
+ if [ -z $1 ] || [ ! -n "$1" ]
+ then
+ _ak_log_error "No key was given"
+ exit 1
+ fi
+ key="$1"
+ _ak_log_info "${key} was given"
+ if [ ! -f ${AK_NS_DIR}/${key} ]
+ then
+ _ak_log_error "${key} was not found"
+ exit 1
+ fi
+ _ak_gpg_verify_clear_signature ${AK_NS_DIR}/${key}
+}
+
function _ak_ns_resolve_from_name(){
# $1; exit;;
if [ -z $1 ] || [ ! -n "$1" ]
@@ -79,29 +96,11 @@ function _ak_ns_resolve_from_name(){
fi
_ak_ns_resolve_from_key ${key}
fi
- _ak_not_implemented "${FUNCNAME}"
-}
-
-function _ak_ns_resolve_from_key(){
- # $1; exit;;
- if [ -z $1 ] || [ ! -n "$1" ]
- then
- _ak_log_error "No key was given"
- exit 1
- fi
- key="$1"
- _ak_log_info "${key} was given"
- if [ ! -f ${AK_NS_DIR}/${key} ]
- then
- _ak_log_error "${key} was not found"
- exit 1
- fi
- _ak_gpg_verify_clear_signature ${AK_NS_DIR}/${key}
- _ak_not_implemented "${FUNCNAME}"
}
function _ak_ns_publish(){
# $1 $2; exit;;
+ _ak_not_implemented "${FUNCNAME}"
if [ -z $1 ] || [ ! -n "$1" ]
then
_ak_log_error "No key was given"
@@ -134,11 +133,11 @@ function _ak_ns_publish(){
then
_ak_gpg_sign_clear_with_key $key
fi
- _ak_not_implemented "${FUNCNAME}"
}
function _ak_ns_publish2name(){
# $1 $2; exit;;
+ _ak_not_implemented "${FUNCNAME}"
if [ -z $1 ] || [ ! -n "$1" ]
then
_ak_log_error "No key name was given"
@@ -156,7 +155,6 @@ function _ak_ns_publish2name(){
exit 1
fi
_ak_ns_publish ${key} $2
- _ak_not_implemented "${FUNCNAME}"
}
function _ak_ns_publish_zchain(){
@@ -169,19 +167,15 @@ function _ak_ns_publish_zchain(){
_ak_ns_create zchain
fi
zchain_key="$(_ak_gpg_list_secret_keys_long | grep 'zchain@keynames.kaos.kaos' | cut -d ' ' -f 1)"
- # We need to prepare the file now to be signed
- # Put the zlatest into a file
zlatest_file="$(_ak_make_temp_file)"
echo -n ${zlatest} > ${zlatest_file}
zlatest_csigned_file="$(_ak_make_temp_file)"
_ak_gpg_sign_clear_with_key ${zlatest_csigned_file} ${zlatest_file} ${zchain_key}
- # What to do now with the clear signed file?
if [ -f ${AK_NS_DIR}/${zchain_key} ]
then
_ak_gpg_verify_clear_signature ${AK_NS_DIR}/${zchain_key} >> ${AK_NS_DIR}/${zchain_key}.history
fi
mv ${zlatest_csigned_file} ${AK_NS_DIR}/${zchain_key}
- # _ak_not_implemented "${FUNCNAME}"
}
function _ak_ns_publish_config(){
@@ -194,19 +188,15 @@ function _ak_ns_publish_config(){
_ak_ns_create zconfig
fi
zconfig_key="$(_ak_gpg_list_secret_keys_long | grep 'zconfig@keynames.kaos.kaos' | cut -d ' ' -f 1)"
- # We need to prepare the file now to be signed
- # Put the zlatest into a file
zconfig_file="$(_ak_make_temp_file)"
echo -n ${zconfig} > ${zconfig_file}
zconfig_csigned_file="$(_ak_make_temp_file)"
_ak_gpg_sign_clear_with_key ${zconfig_csigned_file} ${zconfig_file} ${zconfig_key}
- # What to do now with the clear signed file?
if [ -f ${AK_NS_DIR}/${zconfig_key} ]
then
_ak_gpg_verify_clear_signature ${AK_NS_DIR}/${zconfig_key} >> ${AK_NS_DIR}/${zconfig_key}.history
fi
mv ${zconfig_csigned_file} ${AK_NS_DIR}/${zconfig_key}
- # _ak_not_implemented "${FUNCNAME}"
}
_ak_log_debug "_ak_ns loaded $(caller)"