Browse code

Add --name-types and --enc-types.

Xavier G authored on 28/04/2020 20:27:11
Showing 1 changed files

  • yamltab index 657921c..611d14d 100755
... ...
@@ -537,6 +537,8 @@ def parse_args():
537 537
 	parser.add_argument('--output-format', '-f', dest='output_format', choices=['json', 'yaml'], default='yaml', help='output format (keytab to YAML/JSON only)')
538 538
 	parser.add_argument('--v1-endianness', '-e', dest='v1_endianness', choices=['native', 'little', 'big'], default='native', help='Enforce endianness (keytab v1 to YAML/JSON only)')
539 539
 	parser.add_argument('--simple-to-full', dest='simple_to_full', action='store_true', default=False, help='Convert from simple to full layout (YAML/JSON input only)')
540
+	parser.add_argument('--name-types', dest='list_name_types', action='store_true', default=False, help='List all known name types.')
541
+	parser.add_argument('--enc-types', dest='list_enc_types', action='store_true', default=False, help='List all known encryption types.')
540 542
 	parser.add_argument('input', nargs='?', type=argparse.FileType('rb'), default=sys.stdin.buffer, help='input file; defaults to standard input')
541 543
 	args = parser.parse_args()
542 544
 	return args
... ...
@@ -545,6 +547,10 @@ def main():
545 547
 	args = parse_args()
546 548
 	global VERBOSITY
547 549
 	VERBOSITY=args.verbose
550
+	if args.list_name_types:
551
+		output_data(NAME_TYPES, args, 0)
552
+	if args.list_enc_types:
553
+		output_data(ENC_TYPES, args, 0)
548 554
 	buf = args.input
549 555
 	first_byte = buf.peek(1)[0]
550 556
 	if first_byte == KEYTAB_FIRST_BYTE: