Add crypto-select and crypto-available.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19141 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -383,6 +383,16 @@ command = {
|
|||||||
argument="bytes"
|
argument="bytes"
|
||||||
help = "Generates random bytes and prints them to standard output"
|
help = "Generates random bytes and prints them to standard output"
|
||||||
}
|
}
|
||||||
|
command = {
|
||||||
|
name = "crypto-available"
|
||||||
|
min_args="0"
|
||||||
|
help = "Print available CMS crypto types"
|
||||||
|
}
|
||||||
|
command = {
|
||||||
|
name = "crypto-select"
|
||||||
|
min_args="0"
|
||||||
|
help = "Print available CMS crypto types"
|
||||||
|
}
|
||||||
command = {
|
command = {
|
||||||
name = "help"
|
name = "help"
|
||||||
name = "?"
|
name = "?"
|
||||||
|
@@ -990,6 +990,50 @@ random_data(void *opt, int argc, char **argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
crypto_available(void *opt, int argc, char **argv)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
size_t len, i;
|
||||||
|
AlgorithmIdentifier *val;
|
||||||
|
|
||||||
|
ret = hx509_crypto_available(context, HX509_SELECT_ALL,
|
||||||
|
NULL, &val, &len);
|
||||||
|
if (ret)
|
||||||
|
errx(1, "hx509_crypto_available");
|
||||||
|
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
char *s;
|
||||||
|
der_print_heim_oid (&val[i].algorithm, '.', &s);
|
||||||
|
printf("%s\n", s);
|
||||||
|
free(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
hx509_crypto_free_algs(val, len);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
crypto_select(void *opt, int argc, char **argv)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
char *s;
|
||||||
|
AlgorithmIdentifier val;
|
||||||
|
|
||||||
|
ret = hx509_crypto_select(context, HX509_SELECT_DIGEST,
|
||||||
|
NULL, NULL, &val);
|
||||||
|
if (ret)
|
||||||
|
errx(1, "hx509_crypto_available");
|
||||||
|
|
||||||
|
der_print_heim_oid (&val.algorithm, '.', &s);
|
||||||
|
printf("%s\n", s);
|
||||||
|
free(s);
|
||||||
|
free_AlgorithmIdentifier(&val);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
help(void *opt, int argc, char **argv)
|
help(void *opt, int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user