Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Crypto Wrapper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Turris
Crypto Wrapper
Commits
aea963ec
Verified
Commit
aea963ec
authored
Feb 03, 2019
by
Vojtech Myslivec
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add file signature wrapper function
parent
95caf7a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
crypto-wrapper.sh
crypto-wrapper.sh
+43
-0
No files found.
crypto-wrapper.sh
View file @
aea963ec
...
...
@@ -313,3 +313,46 @@ do_serial() {
return
2
fi
}
do_sign
()
{
local
file
=
"
$1
"
local
tmp
=
''
local
device_type
cache_init
# use stdin if no file is given – store it to temp file
[
-z
"
$file
"
]
&&
{
tmp
=
$(
cache_mktemp
)
debug
"Store stdin to '
$tmp
'"
cat
>
"
$tmp
"
file
=
"
$tmp
"
}
[
-f
"
$file
"
-a
-r
"
$file
"
]
||
{
error
"'
$file
' is not a readable file"
return
1
}
device_type
=
$(
get_device_type
)
case
"
$device_type
"
in
"
$TYPE_ATSHA
"
)
debug
"Call atsha file-challenge-response with '
$file
'"
cached_atsha_challenge_response_file
"
$file
"
;;
"
$TYPE_OTP
"
)
debug
"Call otp sign with '
$file
'"
cached_otp_sign
"
$file
"
;;
*
)
error
"Unsupported device_type '
$device_type
'"
return
2
;;
esac
# remove temp file if it was used
[
-z
"
$tmp
"
]
||
rm
-f
"
$tmp
"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment