drop the unused public-key entry point and the unused flag

This commit is contained in:
lotherk committed 2026-11-21 10:58:00 +00:00
1 parent 0afb114993
commit 2fa11265f6
3 files changed
+7 -22

No files matched your search

+6 -17
View File
@@ -428,30 +428,19 @@ static int parse_pub_text(const char *text, size_t n, const char *label,
return 0;
}
int scr_pub_load(const char *path, struct scr_pub *out)
{
struct buf b = scr_read_file(path, 4 * 1024 * 1024);
int rc;
if (is_private_blob(&b, 8192)) {
scr_die(SCR_EUSAGE,
"%s is a private key; pass the recipient's public key "
"(usually %s.pub)", path, path);
}
rc = parse_pub_text((const char *)b.data, b.len, path, out);
free(b.data);
return rc;
}
int scr_pub_load_any(const char *path, struct scr_pub *out)
{
struct buf b = scr_read_file(path, 4 * 1024 * 1024);
int priv;
priv = is_private_blob(&b, 8192);
if (!priv) {
int rc = parse_pub_text((const char *)b.data, b.len, path, out);
free(b.data);
return rc;
}
free(b.data);
if (!priv)
return scr_pub_load(path, out);
{
struct scr_priv k;
+1 -4
View File
@@ -48,7 +48,7 @@ static const char *need_arg(int argc, char **argv, int *i, const char *opt)
int main(int argc, char **argv)
{
int encrypt = 1, decrypt = 0, fingerprint = 0, binary = 0, quiet = 0;
int decrypt = 0, fingerprint = 0, binary = 0, quiet = 0;
const char *recipient = NULL, *key = NULL, *input = NULL, *output = NULL;
int i;
@@ -71,11 +71,9 @@ int main(int argc, char **argv)
return 0;
}
if (strcmp(a, "-e") == 0 || strcmp(a, "--encrypt") == 0) {
encrypt = 1;
decrypt = 0;
} else if (strcmp(a, "-d") == 0 || strcmp(a, "--decrypt") == 0) {
decrypt = 1;
encrypt = 0;
} else if (strcmp(a, "-r") == 0 || strcmp(a, "--recipient") == 0) {
recipient = need_arg(argc, argv, &i, a);
} else if (strncmp(a, "--recipient=", 12) == 0) {
@@ -193,7 +191,6 @@ int main(int argc, char **argv)
return rc;
}
(void)encrypt;
{
struct scr_pub to;
struct buf in, env;
-1
View File
@@ -61,7 +61,6 @@ struct scr_priv {
char fingerprint[64];
};
int scr_pub_load(const char *path, struct scr_pub *out);
int scr_pub_load_any(const char *path, struct scr_pub *out);
void scr_pub_free(struct scr_pub *k);
int scr_priv_load(const char *path, struct scr_priv *out);