Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
b7b17256
Unverified
Commit
b7b17256
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Set the trust level at the same time as adding a gpg key
parent
a9471097
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-controlpanel-user
+39
-32
39 additions, 32 deletions
src/freedombone-controlpanel-user
with
39 additions
and
32 deletions
src/freedombone-controlpanel-user
+
39
−
32
View file @
b7b17256
...
...
@@ -235,6 +235,41 @@ function email_rule_address {
--msgbox
$"Email rule for
$RULE_EMAIL
was added"
6 40
}
function
gpg_set_trust
{
TRUST_ADDRESS
=
$1
fpr
=
$(
gpg
--with-colons
--fingerprint
"
$TRUST_ADDRESS
"
|
grep
fpr |
head
-n
1 |
awk
-F
':'
'{print $10}'
)
if
[
${#
fpr
}
-gt
2
]
;
then
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--backtitle
$"Freedombone User Control Panel"
\
--title
$"Trust a PGP/GPG key or website domain"
\
--radiolist
$"Set the trust level for
$TRUST_ADDRESS
:"
18 70 10
\
1
$"I don't know or won't say"
off
\
2
$"I do NOT trust"
off
\
3
$"I trust marginally"
on
\
4
$"I trust fully"
off
\
5
$"I trust ultimately"
off 2>
$data
sel
=
$?
case
$sel
in
1
)
return
;;
255
)
return
;;
esac
TRUST_LEVEL
=
$(
cat
$data
)
if
[
${
TRUST_LEVEL
}
-ge
1
]
;
then
if
[
${
TRUST_LEVEL
}
-le
5
]
;
then
echo
-e
"trust
\n
${
TRUST_LEVEL
}
\n
y
\n
save
\n
"
| gpg
--command-fd
0
--edit-key
$fpr
if
[
"
$?
"
=
"0"
]
;
then
gpg
--update-trustdb
dialog
--title
$"Trust a PGP/GPG key or website domain"
\
--backtitle
$"Freedombone User Control Panel"
\
--msgbox
$"
$TRUST_ADDRESS
was set to trust level
${
TRUST_LEVEL
}
"
6 50
fi
fi
fi
fi
}
function
email_rule_subject
{
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
...
...
@@ -394,7 +429,8 @@ function add_gpg_key {
if
[
$address_is_valid
]
;
then
clear
gpg
--search-keys
$ADD_EMAIL_ADDRESS
gpg
--search-keys
"
$ADD_EMAIL_ADDRESS
"
gpg_set_trust
"
$ADD_EMAIL_ADDRESS
"
else
dialog
--title
$"Unrecognised email address"
\
--backtitle
$"Freedombone User Control Panel"
\
...
...
@@ -728,6 +764,7 @@ function sign_gpg_key {
esac
}
function
gpg_key_trust
{
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
...
...
@@ -741,37 +778,7 @@ function gpg_key_trust {
if
[
${#
TRUST_ADDRESS
}
-gt
2
]
;
then
clear
gpg
--search
"
$TRUST_ADDRESS
"
fpr
=
$(
gpg
--with-colons
--fingerprint
"
$TRUST_ADDRESS
"
|
grep
fpr |
head
-n
1 |
awk
-F
':'
'{print $10}'
)
if
[
${#
fpr
}
-gt
2
]
;
then
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--backtitle
$"Freedombone User Control Panel"
\
--title
$"Trust a PGP/GPG key or website domain"
\
--radiolist
$"Set the trust level for
$TRUST_ADDRESS
:"
18 70 10
\
1
$"I don't know or won't say"
off
\
2
$"I do NOT trust"
off
\
3
$"I trust marginally"
on
\
4
$"I trust fully"
off
\
5
$"I trust ultimately"
off 2>
$data
sel
=
$?
case
$sel
in
1
)
return
;;
255
)
return
;;
esac
TRUST_LEVEL
=
$(
cat
$data
)
if
[
${
TRUST_LEVEL
}
-ge
1
]
;
then
if
[
${
TRUST_LEVEL
}
-le
5
]
;
then
echo
-e
"trust
\n
${
TRUST_LEVEL
}
\n
y
\n
save
\n
"
| gpg
--command-fd
0
--edit-key
$fpr
if
[
"
$?
"
=
"0"
]
;
then
gpg
--update-trustdb
dialog
--title
$"Trust a PGP/GPG key or website domain"
\
--backtitle
$"Freedombone User Control Panel"
\
--msgbox
$"
$TRUST_ADDRESS
was set to trust level
${
TRUST_LEVEL
}
"
6 50
fi
fi
fi
fi
gpg_set_trust
"
$TRUST_ADDRESS
"
fi
;;
esac
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment