GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/swissknife_sign.cc
Date: 2026-04-26 02:35:59
Exec Total Coverage
Lines: 0 33 0.0%
Branches: 0 14 0.0%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System
3 *
4 * This tool signs a CernVM-FS manifest with an X.509 certificate.
5 */
6
7 #include "swissknife_sign.h"
8
9 #include <dirent.h>
10 #include <sys/stat.h>
11 #include <sys/types.h>
12 #include <termios.h>
13 #include <unistd.h>
14
15 #include <cstdio>
16 #include <cstdlib>
17 #include <string>
18
19 #include "compression/compression.h"
20 #include "crypto/hash.h"
21 #include "object_fetcher.h"
22 #include "signing_tool.h"
23 #include "util/posix.h" // IWYU pragma: keep
24
25 using namespace std; // NOLINT
26
27 typedef HttpObjectFetcher<> ObjectFetcher;
28
29 int swissknife::CommandSign::Main(const swissknife::ArgumentList &args) {
30 const string manifest_path = *args.find('m')->second;
31 const string repo_url = *args.find('u')->second;
32 const string spooler_definition = *args.find('r')->second;
33 const string temp_dir = *args.find('t')->second;
34
35 string certificate = "";
36 if (args.find('c') != args.end())
37 certificate = *args.find('c')->second;
38 string priv_key = "";
39 if (args.find('k') != args.end())
40 priv_key = *args.find('k')->second;
41 string repo_name = "";
42 if (args.find('n') != args.end())
43 repo_name = *args.find('n')->second;
44 string pwd = "";
45 if (args.find('s') != args.end())
46 pwd = *args.find('s')->second;
47 string meta_info = "";
48 if (args.find('M') != args.end())
49 meta_info = *args.find('M')->second;
50 string proxy = "";
51 if (args.find('@') != args.end())
52 proxy = *args.find('@')->second;
53 const bool garbage_collectable = (args.count('g') > 0);
54 const bool bootstrap_shortcuts = (args.count('A') > 0);
55 const bool return_early = (args.count('e') > 0);
56
57 string reflog_chksum_path;
58 const shash::Any reflog_hash;
59 if (args.find('R') != args.end()) {
60 reflog_chksum_path = *args.find('R')->second;
61 }
62
63 SigningTool signing_tool(this);
64 return signing_tool.Run(manifest_path, repo_url, spooler_definition, temp_dir,
65 certificate, priv_key, repo_name, pwd, meta_info,
66 reflog_chksum_path, proxy, garbage_collectable,
67 bootstrap_shortcuts, return_early);
68 }
69