summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer2020-05-16 16:18:24 +0000
committerMatthias Schiffer2020-05-16 16:26:40 +0000
commit5a738e549d31a54b31ac673af88e23686e453aef (patch)
tree5548d2515e52a0f17506964ad653849b19637684
parent112488bbbccc0581926b65ab093d495bff2dd8cf (diff)
downloaducert-5a738e549d31a54b31ac673af88e23686e453aef.tar.gz
usign-exec: change usign_f_* fingerprint argument to char[17]
This makes it more obvious that a buffer with space for 17 characters is expected to be passed. The code still works the same (a char[17] is equivalent to char* as an argument). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
-rw-r--r--usign-exec.c8
-rw-r--r--usign.h6
2 files changed, 7 insertions, 7 deletions
diff --git a/usign-exec.c b/usign-exec.c
index 436c627..294c794 100644
--- a/usign-exec.c
+++ b/usign-exec.c
@@ -94,7 +94,7 @@ int usign_s(const char *msgfile, const char *seckeyfile, const char *sigfile, bo
* call usign -F ... and set fingerprint returned
* return WEXITSTATUS or -1 if fork fails
*/
-static int usign_f(char *fingerprint, const char *pubkeyfile, const char *seckeyfile, const char *sigfile, bool quiet) {
+static int usign_f(char fingerprint[17], const char *pubkeyfile, const char *seckeyfile, const char *sigfile, bool quiet) {
int fds[2];
pid_t pid;
int status;
@@ -162,21 +162,21 @@ static int usign_f(char *fingerprint, const char *pubkeyfile, const char *seckey
/*
* call usign -F -p ...
*/
-int usign_f_pubkey(char *fingerprint, const char *pubkeyfile, bool quiet) {
+int usign_f_pubkey(char fingerprint[17], const char *pubkeyfile, bool quiet) {
return usign_f(fingerprint, pubkeyfile, NULL, NULL, quiet);
}
/*
* call usign -F -s ...
*/
-int usign_f_seckey(char *fingerprint, const char *seckeyfile, bool quiet) {
+int usign_f_seckey(char fingerprint[17], const char *seckeyfile, bool quiet) {
return usign_f(fingerprint, NULL, seckeyfile, NULL, quiet);
}
/*
* call usign -F -x ...
*/
-int usign_f_sig(char *fingerprint, const char *sigfile, bool quiet) {
+int usign_f_sig(char fingerprint[17], const char *sigfile, bool quiet) {
return usign_f(fingerprint, NULL, NULL, sigfile, quiet);
}
diff --git a/usign.h b/usign.h
index 9c3207a..fc73457 100644
--- a/usign.h
+++ b/usign.h
@@ -37,11 +37,11 @@ int usign_s(const char *msgfile, const char *seckeyfile, const char *sigfile, bo
*
* calls: usign -F ...
*/
-int usign_f_pubkey(char *fingerprint, const char *pubkeyfile, bool quiet);
+int usign_f_pubkey(char fingerprint[17], const char *pubkeyfile, bool quiet);
-int usign_f_seckey(char *fingerprint, const char *seckeyfile, bool quiet);
+int usign_f_seckey(char fingerprint[17], const char *seckeyfile, bool quiet);
-int usign_f_sig(char *fingerprint, const char *sigfile, bool quiet);
+int usign_f_sig(char fingerprint[17], const char *sigfile, bool quiet);
/**
* custom extension to check for revokers