mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
added C pk export
This commit is contained in:
@@ -415,6 +415,12 @@ void pcp_exportpublic(char *keyid, char *passwd, char *outfile, int format, int
|
||||
fprintf(out, "%s", buffer_get_str(exported_pk));
|
||||
}
|
||||
}
|
||||
else if(format == EXP_FORMAT_C) {
|
||||
exported_pk = pcp_export_c_pub(sk);
|
||||
if(exported_pk != NULL) {
|
||||
fprintf(out, "%s", buffer_get_str(exported_pk));
|
||||
}
|
||||
}
|
||||
|
||||
errpcpexpu1:
|
||||
buffer_free(exported_pk);
|
||||
|
||||
@@ -199,6 +199,9 @@ int main (int argc, char **argv) {
|
||||
else if(strncmp(optarg, "perl", 3) == 0) {
|
||||
exportformat = EXP_FORMAT_PERL;
|
||||
}
|
||||
else if(strncmp(optarg, "c", 3) == 0) {
|
||||
exportformat = EXP_FORMAT_C;
|
||||
}
|
||||
else {
|
||||
warn("Unknown export format specified, using native\n");
|
||||
exportformat = EXP_FORMAT_NATIVE;
|
||||
@@ -587,6 +590,7 @@ int main (int argc, char **argv) {
|
||||
}
|
||||
|
||||
fatals_ifany();
|
||||
fatals_done();
|
||||
return PCP_EXIT;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user