pax_global_header00006660000000000000000000000064135002404550014510gustar00rootroot0000000000000052 comment=d7222c2ed55e050d5e0348dc51eaed084dc78340 tomcatjss-7.4.1/000077500000000000000000000000001350024045500135305ustar00rootroot00000000000000tomcatjss-7.4.1/.classpath000066400000000000000000000016621350024045500155200ustar00rootroot00000000000000 tomcatjss-7.4.1/.copr/000077500000000000000000000000001350024045500145515ustar00rootroot00000000000000tomcatjss-7.4.1/.copr/Makefile000066400000000000000000000002521350024045500162100ustar00rootroot00000000000000srpm: dnf install -y git ./build.sh --with-timestamp --with-commit-id srpm if [[ "${outdir}" != "" ]]; then \ mv ${HOME}/build/tomcatjss/SRPMS/* ${outdir}; \ fi tomcatjss-7.4.1/.gitignore000066400000000000000000000000171350024045500155160ustar00rootroot00000000000000bin build dist tomcatjss-7.4.1/.project000066400000000000000000000005601350024045500152000ustar00rootroot00000000000000 tomcatjss org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature tomcatjss-7.4.1/.settings/000077500000000000000000000000001350024045500154465ustar00rootroot00000000000000tomcatjss-7.4.1/.settings/org.eclipse.jdt.core.prefs000066400000000000000000000561231350024045500224370ustar00rootroot00000000000000eclipse.preferences.version=1 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_assignment=0 org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 org.eclipse.jdt.core.formatter.blank_lines_after_package=1 org.eclipse.jdt.core.formatter.blank_lines_before_field=0 org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 org.eclipse.jdt.core.formatter.blank_lines_before_method=1 org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 org.eclipse.jdt.core.formatter.blank_lines_before_package=0 org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false org.eclipse.jdt.core.formatter.comment.format_block_comments=false org.eclipse.jdt.core.formatter.comment.format_header=false org.eclipse.jdt.core.formatter.comment.format_html=true org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true org.eclipse.jdt.core.formatter.comment.format_line_comments=false org.eclipse.jdt.core.formatter.comment.format_source_code=true org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true org.eclipse.jdt.core.formatter.comment.indent_root_tags=true org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert org.eclipse.jdt.core.formatter.comment.line_length=120 org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false org.eclipse.jdt.core.formatter.compact_else_if=true org.eclipse.jdt.core.formatter.continuation_indentation=2 org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_empty_lines=false org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false org.eclipse.jdt.core.formatter.indentation.size=8 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.join_lines_in_comments=false org.eclipse.jdt.core.formatter.join_wrapped_lines=false org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false org.eclipse.jdt.core.formatter.lineSplit=120 org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true org.eclipse.jdt.core.formatter.tabulation.char=space org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.use_on_off_tags=false org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true tomcatjss-7.4.1/.settings/org.eclipse.jdt.ui.prefs000066400000000000000000000052561350024045500221250ustar00rootroot00000000000000eclipse.preferences.version=1 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=_PKI Project Profile formatter_settings_version=12 sp_cleanup.add_default_serial_version_id=true sp_cleanup.add_generated_serial_version_id=false sp_cleanup.add_missing_annotations=false sp_cleanup.add_missing_deprecated_annotations=true sp_cleanup.add_missing_methods=false sp_cleanup.add_missing_nls_tags=false sp_cleanup.add_missing_override_annotations=true sp_cleanup.add_missing_override_annotations_interface_methods=true sp_cleanup.add_serial_version_id=false sp_cleanup.always_use_blocks=true sp_cleanup.always_use_parentheses_in_expressions=false sp_cleanup.always_use_this_for_non_static_field_access=false sp_cleanup.always_use_this_for_non_static_method_access=false sp_cleanup.convert_to_enhanced_for_loop=false sp_cleanup.correct_indentation=false sp_cleanup.format_source_code=false sp_cleanup.format_source_code_changes_only=false sp_cleanup.make_local_variable_final=false sp_cleanup.make_parameters_final=false sp_cleanup.make_private_fields_final=true sp_cleanup.make_type_abstract_if_missing_method=false sp_cleanup.make_variable_declarations_final=false sp_cleanup.never_use_blocks=false sp_cleanup.never_use_parentheses_in_expressions=true sp_cleanup.on_save_use_additional_actions=true sp_cleanup.organize_imports=true sp_cleanup.qualify_static_field_accesses_with_declaring_class=false sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true sp_cleanup.qualify_static_member_accesses_with_declaring_class=false sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false sp_cleanup.remove_unnecessary_casts=true sp_cleanup.remove_unnecessary_nls_tags=false sp_cleanup.remove_unused_imports=true sp_cleanup.remove_unused_local_variables=false sp_cleanup.remove_unused_private_fields=true sp_cleanup.remove_unused_private_members=false sp_cleanup.remove_unused_private_methods=true sp_cleanup.remove_unused_private_types=true sp_cleanup.sort_members=false sp_cleanup.sort_members_all=false sp_cleanup.use_blocks=false sp_cleanup.use_blocks_only_for_return_and_throw=false sp_cleanup.use_parentheses_in_expressions=false sp_cleanup.use_this_for_non_static_field_access=false sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true sp_cleanup.use_this_for_non_static_method_access=false sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true tomcatjss-7.4.1/.travis.yml000066400000000000000000000014551350024045500156460ustar00rootroot00000000000000# BEGIN COPYRIGHT BLOCK # (C) 2018 Red Hat, Inc. # All rights reserved. # END COPYRIGHT BLOCK services: - docker env: - FEDORA=29 - FEDORA=30 install: - docker pull registry.fedoraproject.org/fedora:$FEDORA - docker run --name=container --detach -i -v $(pwd):/root/tomcatjss registry.fedoraproject.org/fedora:$FEDORA - docker exec container dnf install -y dnf-plugins-core gcc make rpm-build - docker exec container dnf copr -y enable ${TOMCATJSS_7_4_REPO:-@pki/master} - docker exec container dnf builddep -y --spec /root/tomcatjss/tomcatjss.spec - docker exec container dnf remove -y tomcat-native - docker exec container /root/tomcatjss/build.sh --with-timestamp --with-commit-id rpm script: - docker exec container rpm -Uvh /root/build/tomcatjss/RPMS/* tomcatjss-7.4.1/LICENSE000066400000000000000000000635041350024045500145450ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! tomcatjss-7.4.1/README000066400000000000000000000107651350024045500144210ustar00rootroot00000000000000JSS Connector for Apache Tomcat, installed via the tomcatjss package, is a Java Secure Socket Extension (JSSE) module for Apache Tomcat that uses Java Security Services (JSS), a Java interface to Network Security Services (NSS). JSS Connector for Apache Tomcat defines a number of attributes for a Connector including: clientauth: specify if client authentication is required in the connector (or port), it can be true or false. If true then client authentication is required. sslOptions: specify a comma-delimited list of ssl options to pass into the ssl implementation. Each option takes the form of: option=[true|false]. JSS Connector for Apache Tomcat supports the options: ssl2, ssl3, tls. ssl2Ciphers: specify a list of SSL2 ciphers that JSS Connector for Apache Tomcat should accept or reject from the client. You can use + to denote "accept", - means "reject" ssl3Ciphers: specifies a list of SSL3 ciphers that JSS Connector for Apache Tomcat should accept or reject from the client. You can use + to denote "accept", - means "reject". tlsCiphers: specifies a list of TLS ciphers that JSS Connector for Apache Tomcat should accept or reject from the client. You can use + to denote "accept", - means "reject". serverCertNickFile: a file in which specify the nickname of the server certificate. The file should contain a single line that contains the nickname. passwordFile: specify a file in which a password that is required to access NSS's security database. Each entry in the file needs to appear on its own line and has the form: token_name=password certdbDir: specify the directory the NSS security database resides in. passwordClass: specify the class that will be used to read the password. sslProtocol: needs to be SSL sslImplementationName: MUST be org.apache.tomcat.util.net.jss.JSSImplementation in order to use the plugin Here is an example of a secure connector: tomcatjss-7.4.1/build.sh000077500000000000000000000207201350024045500151670ustar00rootroot00000000000000#!/bin/bash -e # BEGIN COPYRIGHT BLOCK # (C) 2018 Red Hat, Inc. # All rights reserved. # END COPYRIGHT BLOCK NAME=tomcatjss SCRIPT_PATH=`readlink -f "$0"` SCRIPT_NAME=`basename "$SCRIPT_PATH"` SRC_DIR=`dirname "$SCRIPT_PATH"` WORK_DIR="$HOME/build/$NAME" SOURCE_TAG= WITH_TIMESTAMP= WITH_COMMIT_ID= DIST= VERBOSE= DEBUG= usage() { echo "Usage: $SCRIPT_NAME [OPTIONS] " echo echo "Options:" echo " --work-dir= Working directory (default: $WORK_DIR)." echo " --source-tag= Generate RPM sources from a source tag." echo " --with-timestamp Append timestamp to release number." echo " --with-commit-id Append commit ID to release number." echo " --dist= Distribution name (e.g. fc28)." echo " -v,--verbose Run in verbose mode." echo " --debug Run in debug mode." echo " --help Show help message." echo echo "Target:" echo " src Generate RPM sources." echo " spec Generate RPM spec." echo " srpm Build SRPM package." echo " rpm Build RPM packages (default)." } generate_rpm_sources() { TARBALL="$NAME-$VERSION${_PHASE}.tar.gz" if [ "$SOURCE_TAG" != "" ] ; then if [ "$VERBOSE" = true ] ; then echo "Generating $TARBALL from $SOURCE_TAG tag" fi git -C "$SRC_DIR" \ archive \ --format=tar.gz \ --prefix $NAME-$VERSION${_PHASE}/ \ -o "$WORK_DIR/SOURCES/$TARBALL" \ $SOURCE_TAG if [ "$SOURCE_TAG" != "HEAD" ] ; then TAG_ID=`git -C "$SRC_DIR" rev-parse $SOURCE_TAG` HEAD_ID=`git -C "$SRC_DIR" rev-parse HEAD` if [ "$TAG_ID" != "$HEAD_ID" ] ; then generate_patch fi fi return fi if [ "$VERBOSE" = true ] ; then echo "Generating $TARBALL" fi tar czf "$WORK_DIR/SOURCES/$TARBALL" \ --transform "s,^./,$NAME-$VERSION${_PHASE}/," \ --exclude .git \ --exclude bin \ -C "$SRC_DIR" \ . } generate_patch() { PATCH="$NAME-$VERSION-$RELEASE.patch" if [ "$VERBOSE" = true ] ; then echo "Generating $PATCH for all changes since $SOURCE_TAG tag" fi git -C "$SRC_DIR" \ format-patch \ --stdout \ $SOURCE_TAG \ > "$WORK_DIR/SOURCES/$PATCH" } generate_rpm_spec() { RPM_SPEC="$NAME.spec" if [ "$VERBOSE" = true ] ; then echo "Generating $RPM_SPEC" fi # hard-code timestamp commands="s/%{?_timestamp}/${_TIMESTAMP}/g" # hard-code commit ID commands="${commands}; s/%{?_commit_id}/${_COMMIT_ID}/g" # hard-code phase commands="${commands}; s/%{?_phase}/${_PHASE}/g" # hard-code patch if [ "$PATCH" != "" ] ; then commands="${commands}; s/# Patch: tomcatjss-VERSION-RELEASE.patch/Patch: $PATCH/g" fi sed "$commands" "$SPEC_TEMPLATE" > "$WORK_DIR/SPECS/$RPM_SPEC" # rpmlint "$WORK_DIR/SPECS/$RPM_SPEC" } while getopts v-: arg ; do case $arg in v) VERBOSE=true ;; -) LONG_OPTARG="${OPTARG#*=}" case $OPTARG in work-dir=?*) WORK_DIR=`readlink -f "$LONG_OPTARG"` ;; source-tag=?*) SOURCE_TAG="$LONG_OPTARG" ;; with-timestamp) WITH_TIMESTAMP=true ;; with-commit-id) WITH_COMMIT_ID=true ;; dist=?*) DIST="$LONG_OPTARG" ;; verbose) VERBOSE=true ;; debug) VERBOSE=true DEBUG=true ;; help) usage exit ;; '') break # "--" terminates argument processing ;; work-dir* | source-tag* | dist*) echo "ERROR: Missing argument for --$OPTARG option" >&2 exit 1 ;; *) echo "ERROR: Illegal option --$OPTARG" >&2 exit 1 ;; esac ;; \?) exit 1 # getopts already reported the illegal option ;; esac done # remove parsed options and args from $@ list shift $((OPTIND-1)) if [ "$#" -lt 1 ] ; then BUILD_TARGET=rpm else BUILD_TARGET=$1 fi if [ "$DEBUG" = true ] ; then echo "WORK_DIR: $WORK_DIR" echo "BUILD_TARGET: $BUILD_TARGET" fi if [ "$BUILD_TARGET" != "src" ] && [ "$BUILD_TARGET" != "spec" ] && [ "$BUILD_TARGET" != "srpm" ] && [ "$BUILD_TARGET" != "rpm" ] ; then echo "ERROR: Invalid build target: $BUILD_TARGET" >&2 exit 1 fi SPEC_TEMPLATE="$SRC_DIR/$NAME.spec" VERSION="`rpmspec -P "$SPEC_TEMPLATE" | grep "^Version:" | awk '{print $2;}'`" if [ "$DEBUG" = true ] ; then echo "VERSION: $VERSION" fi RELEASE="`rpmspec -P "$SPEC_TEMPLATE" --undefine dist | grep "^Release:" | awk '{print $2;}'`" if [ "$DEBUG" = true ] ; then echo "RELEASE: $RELEASE" fi spec=$(<"$SPEC_TEMPLATE") regex=$'%global *_phase *([^\n]+)' if [[ $spec =~ $regex ]] ; then _PHASE="${BASH_REMATCH[1]}" fi if [ "$DEBUG" = true ] ; then echo "PHASE: ${_PHASE}" fi if [ "$WITH_TIMESTAMP" = true ] ; then TIMESTAMP="`date +"%Y%m%d%H%M%S"`" _TIMESTAMP=".$TIMESTAMP" fi if [ "$DEBUG" = true ] ; then echo "TIMESTAMP: $TIMESTAMP" fi if [ "$WITH_COMMIT_ID" = true ]; then COMMIT_ID="`git -C "$SRC_DIR" rev-parse --short=8 HEAD`" _COMMIT_ID=".$COMMIT_ID" fi if [ "$DEBUG" = true ] ; then echo "COMMIT_ID: $COMMIT_ID" fi echo "Building $NAME-$VERSION-$RELEASE${_TIMESTAMP}${_COMMIT_ID}" ################################################################################ # Initialize working directory ################################################################################ if [ "$VERBOSE" = true ] ; then echo "Initializing $WORK_DIR" fi mkdir -p $WORK_DIR cd $WORK_DIR rm -rf BUILD rm -rf RPMS rm -rf SOURCES rm -rf SPECS rm -rf SRPMS mkdir BUILD mkdir RPMS mkdir SOURCES mkdir SPECS mkdir SRPMS ################################################################################ # Generate RPM sources ################################################################################ generate_rpm_sources echo "RPM sources:" find "$WORK_DIR/SOURCES" -type f -printf " %p\n" if [ "$BUILD_TARGET" = "src" ] ; then exit fi ################################################################################ # Generate RPM spec ################################################################################ generate_rpm_spec echo "RPM spec:" find "$WORK_DIR/SPECS" -type f -printf " %p\n" if [ "$BUILD_TARGET" = "spec" ] ; then exit fi ################################################################################ # Build source package ################################################################################ OPTIONS=() OPTIONS+=(--quiet) OPTIONS+=(--define "_topdir ${WORK_DIR}") if [ "$WITH_TIMESTAMP" = true ] ; then OPTIONS+=(--define "_timestamp ${_TIMESTAMP}") fi if [ "$WITH_COMMIT_ID" = true ] ; then OPTIONS+=(--define "_commit_id ${_COMMIT_ID}") fi if [ "$DIST" != "" ] ; then OPTIONS+=(--define "dist .$DIST") fi if [ "$DEBUG" = true ] ; then echo "rpmbuild -bs ${OPTIONS[@]} $WORK_DIR/SPECS/$RPM_SPEC" fi # build SRPM with user-provided options rpmbuild -bs "${OPTIONS[@]}" "$WORK_DIR/SPECS/$RPM_SPEC" rc=$? if [ $rc != 0 ]; then echo "ERROR: Unable to build SRPM package" exit 1 fi SRPM=`find "$WORK_DIR/SRPMS" -type f` echo "SRPM package:" echo " $SRPM" if [ "$BUILD_TARGET" = "srpm" ] ; then exit fi ################################################################################ # Build binary packages ################################################################################ OPTIONS=() if [ "$VERBOSE" = true ] ; then OPTIONS+=(--define "_verbose 1") fi OPTIONS+=(--define "_topdir ${WORK_DIR}") if [ "$DEBUG" = true ] ; then echo "rpmbuild --rebuild ${OPTIONS[@]} $SRPM" fi # rebuild RPM with hard-coded options in SRPM rpmbuild --rebuild "${OPTIONS[@]}" "$SRPM" rc=$? if [ $rc != 0 ]; then echo "ERROR: Unable to build RPM packages" exit 1 fi # install SRPM to restore sources and spec file removed during rebuild rpm -i --define "_topdir $WORK_DIR" "$SRPM" # flatten folder find "$WORK_DIR/RPMS" -mindepth 2 -type f -exec mv -i '{}' "$WORK_DIR/RPMS" ';' # remove empty subfolders find "$WORK_DIR/RPMS" -mindepth 1 -type d -delete echo "RPM packages:" find "$WORK_DIR/RPMS" -type f -printf " %p\n" tomcatjss-7.4.1/build.xml000066400000000000000000000240261350024045500153550ustar00rootroot00000000000000 tomcatjss-7.4.1/build_tomcatjss000077500000000000000000000021341350024045500166440ustar00rootroot00000000000000#! /bin/bash # This script may ONLY be run on Linux! OS=`uname` if [ ${OS} != "Linux" ]; then printf "The '$0' script is ONLY executable on a 'Linux' machine!\n" exit 255 fi # If Fedora, retrieve the release if [ -f /etc/fedora-release ]; then FEDORA_RELEASE=`cat /etc/fedora-release | awk {'print $3'}` fi ARCH=`uname -p` if [ "${ARCH}" = "x86_64" ]; then if [ -f /etc/fedora-release ] && [ ${FEDORA_RELEASE} -ge 19 ]; then JNIDIR=/usr/lib/java elif [ -f /etc/fedora-release ] && [ ${FEDORA_RELEASE} -ge 16 ]; then JNIDIR=/usr/lib64/java else JNIDIR=/usr/lib/java fi elif [ ${ARCH} != "i686" ] || [ ${ARCH} != "i586" ] || [ ${ARCH} != "i486" ] || [ ${ARCH} != "i386" ]; then JNIDIR=/usr/lib/java else printf "The '$0' script is NOT executable on the '${ARCH}' architecture!\n" exit 255 fi if [ -f /etc/fedora-release ]; then # Script is being run on Fedora ant -f build.xml -Drhel=0 -Djnidir=${JNIDIR} -Dspecfile=tomcatjss.spec rpms elif [ -f /etc/redhat-release ]; then # Script is being run on RHEL ant -f build.xml -Drhel=1 -Djnidir=${JNIDIR} -Dspecfile=tomcatjss.spec rpms fi tomcatjss-7.4.1/rhel.properties000066400000000000000000000000071350024045500165750ustar00rootroot00000000000000rhel=1 tomcatjss-7.4.1/src/000077500000000000000000000000001350024045500143175ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/000077500000000000000000000000001350024045500151065ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/apache/000077500000000000000000000000001350024045500163275ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/apache/tomcat/000077500000000000000000000000001350024045500176165ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/apache/tomcat/util/000077500000000000000000000000001350024045500205735ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/apache/tomcat/util/net/000077500000000000000000000000001350024045500213615ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/apache/tomcat/util/net/jss/000077500000000000000000000000001350024045500221605ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/apache/tomcat/util/net/jss/IPasswordStore.java000066400000000000000000000025141350024045500257550ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.IOException; import java.util.Enumeration; public interface IPasswordStore { public void init(String pwdPath) throws IOException; public String getPassword(String tag, int iteration); public String getPassword(String tag); public Enumeration getTags(); public Object putPassword(String tag, String password); public void commit() throws IOException, ClassCastException, NullPointerException; } tomcatjss-7.4.1/src/org/apache/tomcat/util/net/jss/PlainPasswordFile.java000066400000000000000000000126141350024045500264150ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.Enumeration; import java.util.Properties; public class PlainPasswordFile implements IPasswordStore { private String mPwdPath = ""; private Properties mPwdStore; private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PlainPasswordFile.class); public PlainPasswordFile() { mPwdStore = new Properties(); } /** * Initialization method to read passwords(key and element pairs) from a file. *

* Every property occupies one line of the input stream. Each line is terminated by a line terminator ( * \n or \r or \r\n). Lines are processed until end of * file is reached. *

* A line that contains only whitespace or whose first non-whitespace character is an ASCII # * is ignored (thus, # indicates comment line). *

* Every line other than a blank line or a comment line describes one property to be added to the table. * The characters before the delimiter = forms the key and the characters after * the = is assigned as value to the key. *

* As an example, each of the following lines specify the key "Truth" and the associated element * value "Beauty": *

* *

     * Truth = Beauty
     * Truth= Beauty
     * Truth                    =Beauty
     * 
* *

* Note that the space appearing before/after = is ignored. However, the space appearing in between are * stored. *

* Example: * *

     * Welcome Message  = Hello World
     * 
* * assigns value Hello World to key Welcome Message *

* * If the line doesn't have the delimiter =, the method throws an IOException * * @param pwdPath the input file path. * @exception IOException if an error occurred when reading from the * input stream. */ public void init(String pwdPath) throws IOException { logger.debug("PlainPasswordFile: Initializing PlainPasswordFile"); // initialize mPwdStore mPwdPath = pwdPath; try (FileInputStream file = new FileInputStream(mPwdPath); InputStreamReader isr = new InputStreamReader(file); BufferedReader br = new BufferedReader(isr)) { String line; int index = 1; while ((line = br.readLine()) != null) { // Remove any leading or trailing spaces line = line.trim(); if (line.startsWith("#") || line.isEmpty()) continue; String[] parts = line.split("=", 2); if (parts.length < 2) { throw new IOException("Missing delimiter '=' in file " + mPwdPath + " in line " + index); } // Load key value into the password store mPwdStore.put(parts[0].trim(), parts[1].trim()); index++; } } } public String getPassword(String tag) { return getPassword(tag, 0); } public String getPassword(String tag, int iteration) { return mPwdStore.getProperty(tag); } // return an array of String-based tag @SuppressWarnings("unchecked") public Enumeration getTags() { return (Enumeration) mPwdStore.propertyNames(); } public Object putPassword(String tag, String password) { return mPwdStore.setProperty(tag, password); } public synchronized void commit() throws IOException, ClassCastException, NullPointerException { try (FileOutputStream file = new FileOutputStream(mPwdPath); OutputStreamWriter osw = new OutputStreamWriter(file); BufferedWriter bw = new BufferedWriter(osw)) { for (Enumeration e = mPwdStore.keys(); e.hasMoreElements();) { String key = ((String) e.nextElement()).trim(); String val = ((String) mPwdStore.get(key)).trim(); bw.write(key + "=" + val); bw.newLine(); } } } public int getSize() { return mPwdStore.size(); } } tomcatjss-7.4.1/src/org/apache/tomcat/util/net/jss/TomcatJSS.java000066400000000000000000000754731350024045500246520ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2017 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.net.SocketException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.Enumeration; import java.util.Properties; import java.util.StringTokenizer; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; import org.apache.commons.lang.StringUtils; import org.mozilla.jss.CryptoManager; import org.mozilla.jss.InitializationValues; import org.mozilla.jss.NoSuchTokenException; import org.mozilla.jss.crypto.AlreadyInitializedException; import org.mozilla.jss.crypto.CryptoToken; import org.mozilla.jss.ssl.SSLAlertEvent; import org.mozilla.jss.ssl.SSLCipher; import org.mozilla.jss.ssl.SSLHandshakeCompletedEvent; import org.mozilla.jss.ssl.SSLProtocolVariant; import org.mozilla.jss.ssl.SSLServerSocket; import org.mozilla.jss.ssl.SSLSocket; import org.mozilla.jss.ssl.SSLSocketListener; import org.mozilla.jss.ssl.SSLVersion; import org.mozilla.jss.ssl.SSLVersionRange; import org.mozilla.jss.util.IncorrectPasswordException; import org.mozilla.jss.util.Password; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; public class TomcatJSS implements SSLSocketListener { public static Logger logger = LoggerFactory.getLogger(TomcatJSS.class); public final static TomcatJSS INSTANCE = new TomcatJSS(); public static final int MAX_LOGIN_ATTEMPTS = 3; public static TomcatJSS getInstance() { return INSTANCE; } Collection socketListeners = new ArrayList(); String certdbDir; CryptoManager manager; String passwordClass; String passwordFile; IPasswordStore passwordStore; String serverCertNickFile; String serverCertNick; String clientAuth = "want"; boolean requireClientAuth; boolean wantClientAuth; boolean enableOCSP; String ocspResponderURL; String ocspResponderCertNickname; int ocspCacheSize = 1000; // entries int ocspMinCacheEntryDuration = 3600; // seconds (default: 1 hour) int ocspMaxCacheEntryDuration = 86400; // seconds (default: 24 hours) int ocspTimeout = 60; // seconds (default: 1 minute) String strictCiphers; boolean boolStrictCiphers; String sslVersionRangeStream; String sslVersionRangeDatagram; String sslRangeCiphers; String sslOptions; String ssl2Ciphers; String ssl3Ciphers; String tlsCiphers; boolean initialized; public void addSocketListener(SSLSocketListener listener) { socketListeners.add(listener); } public void removeSocketListener(SSLSocketListener listener) { socketListeners.remove(listener); } public Collection getSocketListeners() { return socketListeners; } public String getCertdbDir() { return certdbDir; } public void setCertdbDir(String certdbDir) { this.certdbDir = certdbDir; } public String getPasswordClass() { return passwordClass; } public void setPasswordClass(String passwordClass) { this.passwordClass = passwordClass; } public String getPasswordFile() { return passwordFile; } public void setPasswordFile(String passwordFile) { this.passwordFile = passwordFile; } public String getServerCertNickFile() { return serverCertNickFile; } public IPasswordStore getPasswordStore() { return passwordStore; } public void setPasswordStore(IPasswordStore passwordStore) { this.passwordStore = passwordStore; } public void setServerCertNickFile(String serverCertNickFile) { this.serverCertNickFile = serverCertNickFile; } public String getServerCertNick() { return serverCertNick; } public void setServerCertNick(String serverCertNick) { this.serverCertNick = serverCertNick; } public String getClientAuth() { return clientAuth; } public void setClientAuth(String clientAuth) { this.clientAuth = clientAuth; } public boolean getRequireClientAuth() { return requireClientAuth; } public boolean getWantClientAuth() { return wantClientAuth; } public boolean getEnableOCSP() { return enableOCSP; } public void setEnableOCSP(boolean enableOCSP) { this.enableOCSP = enableOCSP; } public String getOcspResponderURL() { return ocspResponderURL; } public void setOcspResponderURL(String ocspResponderURL) { this.ocspResponderURL = ocspResponderURL; } public String getOcspResponderCertNickname() { return ocspResponderCertNickname; } public void setOcspResponderCertNickname(String ocspResponderCertNickname) { this.ocspResponderCertNickname = ocspResponderCertNickname; } public int getOcspCacheSize() { return ocspCacheSize; } public void setOcspCacheSize(int ocspCacheSize) { this.ocspCacheSize = ocspCacheSize; } public int getOcspMinCacheEntryDuration() { return ocspMinCacheEntryDuration; } public void setOcspMinCacheEntryDuration(int ocspMinCacheEntryDuration) { this.ocspMinCacheEntryDuration = ocspMinCacheEntryDuration; } public int getOcspMaxCacheEntryDuration() { return ocspMaxCacheEntryDuration; } public void setOcspMaxCacheEntryDuration(int ocspMaxCacheEntryDuration) { this.ocspMaxCacheEntryDuration = ocspMaxCacheEntryDuration; } public int getOcspTimeout() { return ocspTimeout; } public void setOcspTimeout(int ocspTimeout) { this.ocspTimeout = ocspTimeout; } public String getStrictCiphers() { return strictCiphers; } public void setStrictCiphers(String strictCiphers) { this.strictCiphers = strictCiphers; } public String getSslVersionRangeStream() { return sslVersionRangeStream; } public void setSslVersionRangeStream(String sslVersionRangeStream) { this.sslVersionRangeStream = sslVersionRangeStream; } public String getSslVersionRangeDatagram() { return sslVersionRangeDatagram; } public void setSslVersionRangeDatagram(String sslVersionRangeDatagram) { this.sslVersionRangeDatagram = sslVersionRangeDatagram; } public String getSslRangeCiphers() { return sslRangeCiphers; } public void setSslRangeCiphers(String sslRangeCiphers) { this.sslRangeCiphers = sslRangeCiphers; } public String getSslOptions() { return sslOptions; } public void setSslOptions(String sslOptions) { this.sslOptions = sslOptions; } public String getSsl2Ciphers() { return ssl2Ciphers; } public void setSsl2Ciphers(String ssl2Ciphers) { this.ssl2Ciphers = ssl2Ciphers; } public String getSsl3Ciphers() { return ssl3Ciphers; } public void setSsl3Ciphers(String ssl3Ciphers) { this.ssl3Ciphers = ssl3Ciphers; } public String getTlsCiphers() { return tlsCiphers; } public void setTlsCiphers(String tlsCiphers) { this.tlsCiphers = tlsCiphers; } public void loadJSSConfig(String jssConf) throws Exception { File configFile = new File(jssConf); loadJSSConfig(configFile); } public void loadJSSConfig(File configFile) throws Exception { Properties config = new Properties(); config.load(new FileReader(configFile)); loadJSSConfig(config); } public void loadJSSConfig(Properties config) throws Exception { String certDb = config.getProperty("certdbDir"); if (certDb != null) setCertdbDir(certDb); String passwordClass = config.getProperty("passwordClass"); if (passwordClass != null) setPasswordClass(passwordClass); String passwordFile = config.getProperty("passwordFile"); if (passwordFile != null) setPasswordFile(passwordFile); String enableOCSP = config.getProperty("enableOCSP"); if (enableOCSP != null) setEnableOCSP(Boolean.parseBoolean(enableOCSP)); String ocspResponderURL = config.getProperty("ocspResponderURL"); if (ocspResponderURL != null) setOcspResponderURL(ocspResponderURL); String ocspResponderCertNickname = config.getProperty("ocspResponderCertNickname"); if (ocspResponderCertNickname != null) setOcspResponderCertNickname(ocspResponderCertNickname); String ocspCacheSize = config.getProperty("ocspCacheSize"); if (StringUtils.isNotEmpty(ocspCacheSize)) setOcspCacheSize(Integer.parseInt(ocspCacheSize)); String ocspMinCacheEntryDuration = config.getProperty("ocspMinCacheEntryDuration"); if (StringUtils.isNotEmpty(ocspMinCacheEntryDuration)) setOcspMinCacheEntryDuration(Integer.parseInt(ocspMinCacheEntryDuration)); String ocspMaxCacheEntryDuration = config.getProperty("ocspMaxCacheEntryDuration"); if (StringUtils.isNotEmpty(ocspMaxCacheEntryDuration)) setOcspMaxCacheEntryDuration(Integer.parseInt(ocspMaxCacheEntryDuration)); String ocspTimeout = config.getProperty("ocspTimeout"); if (StringUtils.isNotEmpty(ocspTimeout)) setOcspTimeout(Integer.parseInt(ocspTimeout)); String strictCiphers = config.getProperty("strictCiphers"); if (strictCiphers != null) setStrictCiphers(strictCiphers); String sslVersionRangeStream = config.getProperty("sslVersionRangeStream"); if (sslVersionRangeStream != null) setSslVersionRangeStream(sslVersionRangeStream); String sslVersionRangeDatagram = config.getProperty("sslVersionRangeDatagram"); if (sslVersionRangeDatagram != null) setSslVersionRangeDatagram(sslVersionRangeDatagram); String sslRangeCiphers = config.getProperty("sslRangeCiphers"); if (sslRangeCiphers != null) setSslRangeCiphers(sslRangeCiphers); String sslOptions = config.getProperty("sslOptions"); if (sslOptions != null) setSslOptions(sslOptions); String ssl2Ciphers = config.getProperty("ssl2Ciphers"); if (ssl2Ciphers != null) setSsl2Ciphers(ssl2Ciphers); String ssl3Ciphers = config.getProperty("ssl3Ciphers"); if (ssl3Ciphers != null) setSsl3Ciphers(ssl3Ciphers); String tlsCiphers = config.getProperty("tlsCiphers"); if (tlsCiphers != null) setTlsCiphers(tlsCiphers); } public void loadTomcatConfig(String serverXml) throws Exception { File configFile = new File(serverXml); loadTomcatConfig(configFile); } public void loadTomcatConfig(File configFile) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(configFile); loadTomcatConfig(document); } public void loadTomcatConfig(Document document) throws Exception { XPathFactory xPathfactory = XPathFactory.newInstance(); XPath xpath = xPathfactory.newXPath(); Element connector = (Element) xpath.evaluate( "/Server/Service[@name='Catalina']/Connector[@SSLEnabled='true']", document, XPathConstants.NODE); String certDb = connector.getAttribute("certdbDir"); if (certDb != null) setCertdbDir(certDb); String passwordClass = connector.getAttribute("passwordClass"); if (passwordClass != null) setPasswordClass(passwordClass); String passwordFile = connector.getAttribute("passwordFile"); if (passwordFile != null) setPasswordFile(passwordFile); String serverCertNickFile = connector.getAttribute("serverCertNickFile"); if (serverCertNickFile != null) setServerCertNickFile(serverCertNickFile); String enableOCSP = connector.getAttribute("enableOCSP"); if (enableOCSP != null) setEnableOCSP(Boolean.parseBoolean(enableOCSP)); String ocspResponderURL = connector.getAttribute("ocspResponderURL"); if (ocspResponderURL != null) setOcspResponderURL(ocspResponderURL); String ocspResponderCertNickname = connector.getAttribute("ocspResponderCertNickname"); if (ocspResponderCertNickname != null) setOcspResponderCertNickname(ocspResponderCertNickname); String ocspCacheSize = connector.getAttribute("ocspCacheSize"); if (StringUtils.isNotEmpty(ocspCacheSize)) setOcspCacheSize(Integer.parseInt(ocspCacheSize)); String ocspMinCacheEntryDuration = connector.getAttribute("ocspMinCacheEntryDuration"); if (StringUtils.isNotEmpty(ocspMinCacheEntryDuration)) setOcspMinCacheEntryDuration(Integer.parseInt(ocspMinCacheEntryDuration)); String ocspMaxCacheEntryDuration = connector.getAttribute("ocspMaxCacheEntryDuration"); if (StringUtils.isNotEmpty(ocspMaxCacheEntryDuration)) setOcspMaxCacheEntryDuration(Integer.parseInt(ocspMaxCacheEntryDuration)); String ocspTimeout = connector.getAttribute("ocspTimeout"); if (StringUtils.isNotEmpty(ocspTimeout)) setOcspTimeout(Integer.parseInt(ocspTimeout)); String strictCiphers = connector.getAttribute("strictCiphers"); if (strictCiphers != null) setStrictCiphers(strictCiphers); String sslVersionRangeStream = connector.getAttribute("sslVersionRangeStream"); if (sslVersionRangeStream != null) setSslVersionRangeStream(sslVersionRangeStream); String sslVersionRangeDatagram = connector.getAttribute("sslVersionRangeDatagram"); if (sslVersionRangeDatagram != null) setSslVersionRangeDatagram(sslVersionRangeDatagram); String sslRangeCiphers = connector.getAttribute("sslRangeCiphers"); if (sslRangeCiphers != null) setSslRangeCiphers(sslRangeCiphers); String sslOptions = connector.getAttribute("sslOptions"); if (sslOptions != null) setSslOptions(sslOptions); String ssl2Ciphers = connector.getAttribute("ssl2Ciphers"); if (ssl2Ciphers != null) setSsl2Ciphers(ssl2Ciphers); String ssl3Ciphers = connector.getAttribute("ssl3Ciphers"); if (ssl3Ciphers != null) setSsl3Ciphers(ssl3Ciphers); String tlsCiphers = connector.getAttribute("tlsCiphers"); if (tlsCiphers != null) setTlsCiphers(tlsCiphers); } public void init() throws Exception { if (initialized) { return; } logger.info("TomcatJSS: initialization"); if (certdbDir == null) { certdbDir = System.getProperty("catalina.base") + File.separator + "alias"; } logger.debug("TomcatJSS: certdbDir: " + certdbDir); if (passwordClass == null) { passwordClass = PlainPasswordFile.class.getName(); } logger.debug("TomcatJSS: passwordClass: " + passwordClass); if (passwordFile == null) { passwordFile = System.getProperty("catalina.base") + File.separator + "conf" + File.separator + "password.conf"; } logger.debug("TomcatJSS: passwordFile: " + passwordFile); if (serverCertNickFile != null) { logger.debug("TomcatJSS: serverCertNickFile: " + serverCertNickFile); } InitializationValues vals = new InitializationValues(certdbDir); vals.removeSunProvider = false; vals.installJSSProvider = true; try { CryptoManager.initialize(vals); } catch (AlreadyInitializedException e) { logger.warn("TomcatJSS: " + e); } manager = CryptoManager.getInstance(); passwordStore = (IPasswordStore) Class.forName(passwordClass).newInstance(); passwordStore.init(passwordFile); login(); if (serverCertNickFile != null) { serverCertNick = new String(Files.readAllBytes(Paths.get(serverCertNickFile))).trim(); logger.debug("serverCertNick: " + serverCertNick); } logger.debug("clientAuth: " + clientAuth); if (clientAuth.equalsIgnoreCase("true")) { requireClientAuth = true; } else if (clientAuth.equalsIgnoreCase("yes")) { requireClientAuth = true; logger.warn("The \"yes\" value for clientAuth has been deprecated. Use \"true\" instead."); } else if (clientAuth.equalsIgnoreCase("want")) { wantClientAuth = true; } logger.debug("requireClientAuth: " + requireClientAuth); logger.debug("wantClientAuth: " + wantClientAuth); if (requireClientAuth || wantClientAuth) { configureOCSP(); } // 12 hours = 43200 seconds SSLServerSocket.configServerSessionIDCache(0, 43200, 43200, null); logger.debug("strictCiphers: " + strictCiphers); if ("true".equalsIgnoreCase(strictCiphers)) { boolStrictCiphers = true; } else if ("yes".equalsIgnoreCase(strictCiphers)) { boolStrictCiphers = true; logger.warn("The \"yes\" value for strictCiphers has been deprecated. Use \"true\" instead."); } if (boolStrictCiphers) { // what ciphers do we have to start with? turn them all off unsetSSLCiphers(); } logger.debug("sslVersionRangeStream: " + sslVersionRangeStream); if (StringUtils.isNotEmpty(sslVersionRangeStream)) { setSSLVersionRangeDefault( "STREAM", SSLProtocolVariant.STREAM, sslVersionRangeStream); } logger.debug("sslVersionRangeDatagram: " + sslVersionRangeDatagram); if (StringUtils.isNotEmpty(sslVersionRangeDatagram)) { setSSLVersionRangeDefault( "DATA_GRAM", SSLProtocolVariant.DATA_GRAM, sslVersionRangeDatagram); } /* * According to NSS: the SSL_OptionSet-based API for controlling the * enabled protocol versions are obsolete and replaced by the * setSSLVersionRange calls. Therefore, if the "range" parameters * are present in the attributes then the sslOptions parameter is * ignored. Using the new version range API in conjunction with the * older SSL_OptionSet-based API for controlling the enabled * protocol versions may cause unexpected results */ if (StringUtils.isNotEmpty(sslVersionRangeStream) || StringUtils.isNotEmpty(sslVersionRangeDatagram)) { /* deliberately lose the ssl2 here */ setSSLCiphers("sslRangeCiphers", sslRangeCiphers); } else { setSSLOptions(); } logger.info("TomcatJSS: initialization complete"); initialized = true; } public void login() throws Exception { logger.debug("TomcatJSS: logging into tokens"); Enumeration tags = passwordStore.getTags(); while (tags.hasMoreElements()) { String tag = tags.nextElement(); if (!tag.equals("internal") && !tag.startsWith("hardware-")) { continue; } login(tag); } } public void login(String tag) throws Exception { CryptoToken token; try { token = getToken(tag); } catch (NoSuchTokenException e) { logger.warn("TomcatJSS: token for " + tag + " not found"); return; } if (token.isLoggedIn()) { logger.debug("TomcatJSS: already logged into " + tag); return; } logger.debug("TomcatJSS: logging into " + tag); int iteration = 0; do { String strPassword = passwordStore.getPassword(tag, iteration); if (strPassword == null) { logger.debug("TomcatJSS: no password for " + tag); return; } Password password = new Password(strPassword.toCharArray()); try { token.login(password); return; } catch (IncorrectPasswordException e) { logger.warn("TomcatJSS: incorrect password"); iteration ++; } finally { password.clear(); } } while (iteration < MAX_LOGIN_ATTEMPTS); logger.error("TomcatJSS: failed to log into " + tag); } public CryptoToken getToken(String tag) throws Exception { if (tag.equals("internal")) { return manager.getInternalKeyStorageToken(); } if (tag.startsWith("hardware-")) { String tokenName = tag.substring(9); return manager.getTokenByName(tokenName); } // non-token password entry return null; } public void configureOCSP() throws Exception { logger.info("configuring OCSP"); logger.debug("enableOCSP: " + enableOCSP); if (!enableOCSP) { return; } logger.debug("ocspResponderURL: " + ocspResponderURL); if (StringUtils.isEmpty(ocspResponderURL)) { ocspResponderURL = null; } logger.debug("ocspResponderCertNickname: " + ocspResponderCertNickname); if (StringUtils.isEmpty(ocspResponderCertNickname)) { ocspResponderCertNickname = null; } // Check to see if the ocsp url and nickname are both set or not set if (ocspResponderURL == null && ocspResponderCertNickname != null) { throw new Exception("Missing OCSP responder URL"); } if (ocspResponderURL != null && ocspResponderCertNickname == null) { throw new Exception("Missing OCSP responder certificate nickname"); } manager.configureOCSP( true, ocspResponderURL, ocspResponderCertNickname); logger.debug("ocspCacheSize: " + ocspCacheSize); logger.debug("ocspMinCacheEntryDuration: " + ocspMinCacheEntryDuration); logger.debug("ocspMaxCacheEntryDuration: " + ocspMaxCacheEntryDuration); manager.OCSPCacheSettings(ocspCacheSize, ocspMinCacheEntryDuration, ocspMaxCacheEntryDuration); logger.debug("ocspTimeout: " + ocspTimeout); manager.setOCSPTimeout(ocspTimeout); } /** * Disables all SSL ciphers to start with a clean slate. */ public void unsetSSLCiphers() throws SocketException { logger.debug("Disabling SSL ciphers:"); int[] cipherIDs = SSLSocket.getImplementedCipherSuites(); if (cipherIDs == null) return; for (int cipherID : cipherIDs) { StringBuilder sb = new StringBuilder(); sb.append("* 0x"); sb.append(Integer.toHexString(cipherID)); SSLCipher cipher = SSLCipher.valueOf(cipherID); if (cipher != null) { sb.append(": "); sb.append(cipher.name()); } logger.debug(sb.toString()); SSLSocket.setCipherPreferenceDefault(cipherID, false); } } /** * setSSLVersionRangeDefault sets the range of allowed SSL versions. This * replaces the obsolete SSL_Option* API. * * @param protoVariant indicates whether this setting is for type "stream" * or "datagram". * * @param sslVersionRange_s takes on the form of "min:max" where min/max * values can be "ssl3, tls1_0, tls1_1, tls1_2, tls1_3". ssl2 is not * supported for tomcatjss via this interface. The format is * "sslVersionRange=min:max". */ public void setSSLVersionRangeDefault( String type, SSLProtocolVariant protoVariant, String sslVersionRange_s) throws SocketException, IllegalArgumentException, IOException { String[] sslVersionRange = sslVersionRange_s.split(":"); if (sslVersionRange.length != 2) { throw new SocketException("SSL version range format error: " + sslVersionRange_s); } String min_s = sslVersionRange[0]; String max_s = sslVersionRange[1]; logger.debug("Setting SSL version range for " + type + ":"); logger.debug("* min: " + min_s); logger.debug("* max: " + max_s); SSLVersion minVersion = SSLVersion.findByAlias(min_s); SSLVersion maxVersion = SSLVersion.findByAlias(max_s); SSLVersionRange range = new SSLVersionRange(minVersion, maxVersion); range = SSLSocket.boundSSLVersionRange(SSLProtocolVariant.STREAM, range); logger.debug("Actual SSL version range for " + type + " after system policy correction:"); logger.debug("* min: " + range.getMinVersion()); logger.debug("* max: " + range.getMaxVersion()); SSLSocket.setSSLVersionRangeDefault(protoVariant, range); } public void setSSLCiphers(String attr, String ciphers) throws SocketException, IOException { if (StringUtils.isEmpty(ciphers)) { logger.debug("Missing " + attr); return; } logger.debug("Processing " + attr + ":"); StringTokenizer st = new StringTokenizer(ciphers, ", "); while (st.hasMoreTokens()) { String cipherStr = st.nextToken(); String name; boolean enabled; if (cipherStr.startsWith("+")) { enabled = true; name = cipherStr.substring(1); } else if (cipherStr.startsWith("-")) { enabled = false; name = cipherStr.substring(1); } else { enabled = true; // no enable/disable flag, assume enable name = cipherStr; } logger.debug("* " + name); logger.debug(" enabled: " + enabled); int cipherID; if (name.startsWith("0x") || name.startsWith("0X")) { // this allows us to specify new ciphers try { cipherID = Integer.parseInt(name.substring(2), 16); } catch (Exception e) { logger.error("Invalid SSL cipher: " + name); continue; } } else { try { SSLCipher cipher = SSLCipher.valueOf(name); cipherID = cipher.getID(); } catch (IllegalArgumentException e) { logger.error("Unknown SSL cipher: " + name); continue; } } logger.debug(" ID: 0x" + Integer.toHexString(cipherID)); try { SSLSocket.setCipherPreferenceDefault(cipherID, enabled); } catch (Exception e) { logger.warn("Unable to set SSL cipher preference: " + e); SSLCipher cipher = SSLCipher.valueOf(cipherID); if (cipher != null && cipher.isECC()) { logger.warn("SSL ECC cipher \"" + name + "\" unsupported by NSS. " + "This is probably O.K. unless ECC support has been installed."); } else { logger.error("SSL cipher \"" + name + "\" unsupported by NSS"); } } } } /** * note: the SSL_OptionSet-based API for controlling the enabled protocol * versions are obsolete and replaced by the setSSLVersionRange calls. If * the "range" parameters are present in the attributes then the sslOptions * parameter is ignored. */ public void setSSLOptions() throws SocketException, IOException { if (StringUtils.isEmpty(sslOptions)) { logger.debug("JSSSocketFactory: no sslOptions specified"); return; } logger.debug("JSSSocketFactory: Processing sslOptions:"); StringTokenizer st = new StringTokenizer(sslOptions, ", "); while (st.hasMoreTokens()) { String option = st.nextToken(); logger.debug("JSSSocketFactory: - " + option); StringTokenizer st1 = new StringTokenizer(option, "="); String name = st1.nextToken(); String value = st1.nextToken(); if (name.equals("ssl2")) { if (value.equals("true")) { SSLSocket.enableSSL2Default(true); setSSLCiphers("ssl2Ciphers", ssl2Ciphers); } else { SSLSocket.enableSSL2Default(false); } } if (name.equals("ssl3")) { if (value.equals("true")) { SSLSocket.enableSSL3Default(true); setSSLCiphers("ssl3Ciphers", ssl3Ciphers); } else { SSLSocket.enableSSL3Default(false); } } if (name.equals("tls")) { if (value.equals("true")) { SSLSocket.enableTLSDefault(true); setSSLCiphers("tlsCiphers", tlsCiphers); } else { SSLSocket.enableTLSDefault(false); } } } } @Override public void alertReceived(SSLAlertEvent event) { for (SSLSocketListener listener : socketListeners) { listener.alertReceived(event); } } @Override public void alertSent(SSLAlertEvent event) { for (SSLSocketListener listener : socketListeners) { listener.alertSent(event); } } @Override public void handshakeCompleted(SSLHandshakeCompletedEvent event) { for (SSLSocketListener listener : socketListeners) { listener.handshakeCompleted(event); } } } tomcatjss-7.4.1/src/org/dogtagpki/000077500000000000000000000000001350024045500170575ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/dogtagpki/tomcat/000077500000000000000000000000001350024045500203465ustar00rootroot00000000000000tomcatjss-7.4.1/src/org/dogtagpki/tomcat/Http11NioProtocol.java000066400000000000000000000123051350024045500244630ustar00rootroot00000000000000package org.dogtagpki.tomcat; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import org.apache.tomcat.util.net.jss.TomcatJSS; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Http11NioProtocol extends org.apache.coyote.http11.Http11NioProtocol { public static Logger logger = LoggerFactory.getLogger(Http11NioProtocol.class); TomcatJSS tomcatjss = TomcatJSS.getInstance(); public String getCertdbDir() { return tomcatjss.getCertdbDir(); } public void setCertdbDir(String certdbDir) { tomcatjss.setCertdbDir(certdbDir); } public String getPasswordClass() { return tomcatjss.getPasswordClass(); } public void setPasswordClass(String passwordClass) { tomcatjss.setPasswordClass(passwordClass); } public String getPasswordFile() { return tomcatjss.getPasswordFile(); } public void setPasswordFile(String passwordFile) { tomcatjss.setPasswordFile(passwordFile); } public String getServerCertNickFile() { return tomcatjss.getServerCertNickFile(); } public void setServerCertNickFile(String serverCertNickFile) { tomcatjss.setServerCertNickFile(serverCertNickFile); } public boolean getEnabledOCSP() { return tomcatjss.getEnableOCSP(); } public void setEnableOCSP(boolean enableOCSP) { tomcatjss.setEnableOCSP(enableOCSP); } public String getOcspResponderURL() { return tomcatjss.getOcspResponderURL(); } public void setOcspResponderURL(String ocspResponderURL) { tomcatjss.setOcspResponderURL(ocspResponderURL); } public String getOcspResponderCertNickname() { return tomcatjss.getOcspResponderCertNickname(); } public void setOcspResponderCertNickname(String ocspResponderCertNickname) { tomcatjss.setOcspResponderCertNickname(ocspResponderCertNickname); } public int getOcspCacheSize() { return tomcatjss.getOcspCacheSize(); } public void setOcspCacheSize(int ocspCacheSize) { tomcatjss.setOcspCacheSize(ocspCacheSize); } public int getOcspMinCacheEntryDuration() { return tomcatjss.getOcspMinCacheEntryDuration(); } public void setOcspMinCacheEntryDuration(int ocspMinCacheEntryDuration) { tomcatjss.setOcspMinCacheEntryDuration(ocspMinCacheEntryDuration); } public int getOcspMaxCacheEntryDuration() { return tomcatjss.getOcspMaxCacheEntryDuration(); } public void setOcspMaxCacheEntryDuration(int ocspMaxCacheEntryDuration) { tomcatjss.setOcspMaxCacheEntryDuration(ocspMaxCacheEntryDuration); } public int getOcspTimeout() { return tomcatjss.getOcspTimeout(); } public void setOcspTimeout(int ocspTimeout) { tomcatjss.setOcspTimeout(ocspTimeout); } public String getStrictCiphers() { return tomcatjss.getStrictCiphers(); } public void setStrictCiphers(String strictCiphers) { tomcatjss.setStrictCiphers(strictCiphers); } public String getSslVersionRangeStream() { return tomcatjss.getSslVersionRangeStream(); } public void setSslVersionRangeStream(String sslVersionRangeStream) { tomcatjss.setSslVersionRangeStream(sslVersionRangeStream); } public String getSslVersionRangeDatagram() { return tomcatjss.getSslVersionRangeDatagram(); } public void setSslVersionRangeDatagram(String sslVersionRangeDatagram) { tomcatjss.setSslVersionRangeDatagram(sslVersionRangeDatagram);; } public String getSslRangeCiphers() { return tomcatjss.getSslRangeCiphers(); } public void setSslRangeCiphers(String sslRangeCiphers) { tomcatjss.setSslRangeCiphers(sslRangeCiphers); } public String getSslOptions() { return tomcatjss.getSslOptions(); } public void setSslOptions(String sslOptions) { tomcatjss.setSslOptions(sslOptions); } public String getSsl2Ciphers() { return tomcatjss.getSsl2Ciphers(); } public void setSsl2Ciphers(String ssl2Ciphers) { tomcatjss.setSsl2Ciphers(ssl2Ciphers); } public String getSsl3Ciphers() { return tomcatjss.getSsl3Ciphers(); } public void setSsl3Ciphers(String ssl3Ciphers) { tomcatjss.setSsl3Ciphers(ssl3Ciphers); } public String getTlsCiphers() { return tomcatjss.getTlsCiphers(); } public void setTlsCiphers(String tlsCiphers) { tomcatjss.setTlsCiphers(tlsCiphers); } public void setKeystorePassFile(String keystorePassFile) { try { Path path = Paths.get(keystorePassFile); String password = new String(Files.readAllBytes(path)).trim(); setKeystorePass(password); } catch (IOException e) { throw new RuntimeException(e); } } public void setTruststorePassFile(String truststorePassFile) { try { Path path = Paths.get(truststorePassFile); String password = new String(Files.readAllBytes(path)).trim(); setTruststorePass(password); } catch (IOException e) { throw new RuntimeException(e); } } } tomcatjss-7.4.1/src/org/dogtagpki/tomcat/JSSKeyManager.java000066400000000000000000000115631350024045500236220ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2017 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.dogtagpki.tomcat; import java.net.Socket; import java.security.Principal; import java.security.PrivateKey; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collection; import javax.net.ssl.X509KeyManager; import org.mozilla.jss.CryptoManager; import org.mozilla.jss.crypto.ObjectNotFoundException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sun.security.x509.X509CertImpl; public class JSSKeyManager implements X509KeyManager { final static Logger logger = LoggerFactory.getLogger(JSSKeyManager.class); @Override public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) { logger.debug("JSSKeyManager: chooseClientAlias()"); logger.debug("JSSKeyManager: key types:"); for (String keyType : keyTypes) { logger.debug("JSSKeyManager: - " + keyType); } logger.debug("JSSKeyManager: issuers:"); for (Principal issuer : issuers) { logger.debug("JSSKeyManager: - " + issuer.getName()); } return null; // not implemented } @Override public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) { logger.debug("JSSKeyManager: chooseServerAlias()"); logger.debug("JSSKeyManager: key type: " + keyType); logger.debug("JSSKeyManager: issuers:"); for (Principal issuer : issuers) { logger.debug("JSSKeyManager: - " + issuer.getName()); } return null; // not implemented } @Override public X509Certificate[] getCertificateChain(String alias) { logger.debug("JSSKeyManager: getCertificateChain(" + alias + ")"); try { CryptoManager cm = CryptoManager.getInstance(); org.mozilla.jss.crypto.X509Certificate cert = cm.findCertByNickname(alias); org.mozilla.jss.crypto.X509Certificate[] chain = cm.buildCertificateChain(cert); logger.debug("JSSKeyManager: cert chain:"); Collection list = new ArrayList<>(); for (org.mozilla.jss.crypto.X509Certificate c : chain) { logger.debug("JSSKeyManager: - " + c.getSubjectDN()); list.add(new X509CertImpl(c.getEncoded())); } return list.toArray(new X509Certificate[list.size()]); } catch (Throwable e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } } @Override public String[] getClientAliases(String keyType, Principal[] issuers) { logger.debug("JSSKeyManager: getClientAliases()"); logger.debug("JSSKeyManager: key type: " + keyType); logger.debug("JSSKeyManager: issuers:"); for (Principal issuer : issuers) { logger.debug("JSSKeyManager: - " + issuer.getName()); } return null; // not implemented } @Override public PrivateKey getPrivateKey(String alias) { logger.debug("JSSKeyManager: getPrivateKey(" + alias + ")"); try { CryptoManager cm = CryptoManager.getInstance(); org.mozilla.jss.crypto.X509Certificate cert = cm.findCertByNickname(alias); PrivateKey privateKey = cm.findPrivKeyByCert(cert); logger.debug("JSSKeyManager: key found: " + alias); return privateKey; } catch (ObjectNotFoundException e) { logger.debug("JSSKeyManager: key not found: " + alias); return null; } catch (Throwable e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } } @Override public String[] getServerAliases(String keyType, Principal[] issuers) { logger.debug("JSSKeyManager: getServerAliases()"); logger.debug("JSSKeyManager: key type: " + keyType); logger.debug("JSSKeyManager: issuers:"); for (Principal issuer : issuers) { logger.debug("JSSKeyManager: - " + issuer.getName()); } return null; // not implemented } } tomcatjss-7.4.1/src/org/dogtagpki/tomcat/JSSListener.java000066400000000000000000000050201350024045500233530ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2019 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.dogtagpki.tomcat; import java.io.File; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; import org.apache.tomcat.util.net.jss.TomcatJSS; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JSSListener implements LifecycleListener { final static Logger logger = LoggerFactory.getLogger(JSSListener.class); public String configFile; public String getConfigFile() { return configFile; } public void setConfigFile(String configFile) { this.configFile = configFile; } @Override public void lifecycleEvent(LifecycleEvent event) { String type = event.getType(); if (type.equals(Lifecycle.BEFORE_INIT_EVENT)) { initJSS(); } } public void initJSS() { logger.info("JSSListener: Initializing JSS"); try { TomcatJSS tomcatjss = TomcatJSS.getInstance(); String catalinaBase = System.getProperty("catalina.base"); String jssConf = catalinaBase + "/conf/jss.conf"; File configFile = new File(jssConf); if (configFile.exists()) { logger.info("JSSListener: Loading JSS configuration from " + jssConf); tomcatjss.loadJSSConfig(configFile); } else { String serverXml = catalinaBase + "/conf/server.xml"; logger.info("JSSListener: Loading JSS configuration from " + serverXml); tomcatjss.loadTomcatConfig(serverXml); } tomcatjss.init(); } catch (Exception e) { throw new RuntimeException(e); } } } tomcatjss-7.4.1/src/org/dogtagpki/tomcat/JSSTrustManager.java000066400000000000000000000156621350024045500242170ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2017 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.dogtagpki.tomcat; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import javax.net.ssl.X509TrustManager; import org.mozilla.jss.CryptoManager; import org.mozilla.jss.NotInitializedException; import org.mozilla.jss.netscape.security.util.Cert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sun.security.x509.X509CertImpl; public class JSSTrustManager implements X509TrustManager { final static Logger logger = LoggerFactory.getLogger(JSSTrustManager.class); final static String SERVER_AUTH_OID = "1.3.6.1.5.5.7.3.1"; final static String CLIENT_AUTH_OID = "1.3.6.1.5.5.7.3.2"; public void checkCertChain(X509Certificate[] certChain, String keyUsage) throws Exception { logger.debug("JSSTrustManager: checkCertChain(" + keyUsage + ")"); // sort cert chain from root to leaf certChain = Cert.sortCertificateChain(certChain); for (X509Certificate cert : certChain) { logger.debug("JSSTrustManager: - " + cert.getSubjectDN()); } // get CA certs X509Certificate[] caCerts = getAcceptedIssuers(); // validating cert chain from root to leaf for (int i = 0; i < certChain.length; i++) { X509Certificate cert = certChain[i]; // validating key usage on leaf cert only String usage; if (i == certChain.length - 1) { usage = keyUsage; } else { usage = null; } checkCert(cert, caCerts, usage); // use the current cert as the CA cert for the next cert in the chain caCerts = new X509Certificate[] { cert }; } } public void checkCert(X509Certificate cert, X509Certificate[] caCerts, String keyUsage) throws Exception { logger.debug("JSSTrustManager: checkCert(" + cert.getSubjectDN() + "):"); boolean[] aki = cert.getIssuerUniqueID(); logger.debug("JSSTrustManager: cert AKI: " + Arrays.toString(aki)); X509Certificate issuer = null; for (X509Certificate caCert : caCerts) { boolean[] ski = caCert.getSubjectUniqueID(); logger.debug("JSSTrustManager: SKI of " + caCert.getSubjectDN() + ": " + Arrays.toString(ski)); try { cert.verify(caCert.getPublicKey(), "Mozilla-JSS"); issuer = caCert; break; } catch (Exception e) { logger.debug("JSSTrustManager: invalid certificate: " + e); } } if (issuer == null) { throw new CertificateException("Unable to validate signature: " + cert.getSubjectDN()); } logger.debug("JSSTrustManager: cert signed by " + issuer.getSubjectDN()); logger.debug("JSSTrustManager: checking validity range:"); logger.debug("JSSTrustManager: - not before: " + cert.getNotBefore()); logger.debug("JSSTrustManager: - not after: " + cert.getNotAfter()); cert.checkValidity(); if (keyUsage != null) { List extendedKeyUsages = cert.getExtendedKeyUsage(); logger.debug("JSSTrustManager: checking extended key usages:"); for (String extKeyUsage : extendedKeyUsages) { logger.debug("JSSTrustManager: - " + extKeyUsage); } if (extendedKeyUsages.contains(keyUsage)) { logger.debug("JSSTrustManager: extended key usage found: " + keyUsage); } else { throw new CertificateException("Missing extended key usage: " + keyUsage); } } } @Override public void checkClientTrusted(X509Certificate[] certChain, String authType) throws CertificateException { logger.debug("JSSTrustManager: checkClientTrusted(" + authType + "):"); try { checkCertChain(certChain, CLIENT_AUTH_OID); logger.debug("JSSTrustManager: SSL client certificate is valid"); } catch (CertificateException e) { logger.warn("JSSTrustManager: Invalid SSL client certificate: " + e); throw e; } catch (Exception e) { logger.warn("JSSTrustManager: Unable to validate certificate: " + e); throw new CertificateException(e); } } @Override public void checkServerTrusted(X509Certificate[] certChain, String authType) throws CertificateException { logger.debug("JSSTrustManager: checkServerTrusted(" + certChain.length + ", " + authType + "):"); try { checkCertChain(certChain, SERVER_AUTH_OID); logger.debug("JSSTrustManager: SSL server certificate is valid"); } catch (CertificateException e) { logger.warn("JSSTrustManager: Invalid SSL server certificate: " + e); throw e; } catch (Exception e) { logger.warn("JSSTrustManager: Unable to validate SSL server certificate: " + e); throw new CertificateException(e); } } @Override public X509Certificate[] getAcceptedIssuers() { logger.debug("JSSTrustManager: getAcceptedIssuers():"); Collection caCerts = new ArrayList<>(); try { CryptoManager manager = CryptoManager.getInstance(); for (org.mozilla.jss.crypto.X509Certificate cert : manager.getCACerts()) { logger.debug("JSSTrustManager: - " + cert.getSubjectDN()); try { X509CertImpl caCert = new X509CertImpl(cert.getEncoded()); caCert.checkValidity(); caCerts.add(caCert); } catch (Exception e) { logger.debug("JSSTrustManager: invalid CA certificate: " + e); } } } catch (NotInitializedException e) { logger.error("JSSTrustManager: Unable to get CryptoManager: " + e, e); throw new RuntimeException(e); } return caCerts.toArray(new X509Certificate[caCerts.size()]); } } tomcatjss-7.4.1/tomcat-7.0/000077500000000000000000000000001350024045500153215ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/000077500000000000000000000000001350024045500161105ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/000077500000000000000000000000001350024045500166775ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/apache/000077500000000000000000000000001350024045500201205ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/000077500000000000000000000000001350024045500214075ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/util/000077500000000000000000000000001350024045500223645ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/util/net/000077500000000000000000000000001350024045500231525ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/util/net/jss/000077500000000000000000000000001350024045500237515ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/util/net/jss/IJSSFactory.java000066400000000000000000000024021350024045500267120ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.net.Socket; import java.util.Properties; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.SSLSupport; import org.apache.tomcat.util.net.ServerSocketFactory; interface IJSSFactory { public ServerSocketFactory getSocketFactory(AbstractEndpoint endpoint, Properties config); public SSLSupport getSSLSupport(Socket socket); } tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/util/net/jss/JSSFactory.java000066400000000000000000000027141350024045500266070ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.net.Socket; import java.util.Properties; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.SSLSupport; import org.apache.tomcat.util.net.ServerSocketFactory; import org.mozilla.jss.ssl.SSLSocket; class JSSFactory implements IJSSFactory { JSSFactory() { } public ServerSocketFactory getSocketFactory(AbstractEndpoint endpoint, Properties config) { return new JSSSocketFactory(endpoint, config); } public SSLSupport getSSLSupport(Socket socket) { return new JSSSupport((SSLSocket) socket); } } tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/util/net/jss/JSSImplementation.java000066400000000000000000000101501350024045500301560ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.net.Socket; import java.util.Properties; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.SSLImplementation; import org.apache.tomcat.util.net.SSLSupport; import org.apache.tomcat.util.net.SSLUtil; import org.apache.tomcat.util.net.ServerSocketFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JSSImplementation extends SSLImplementation { public static Logger logger = LoggerFactory.getLogger(JSSImplementation.class); static final String JSSFactory = "org.apache.tomcat.util.net.jss.JSSFactory"; static final String SSLSocketClass = "org.mozilla.jss.ssl.SSLSocket"; private JSSFactory factory = null; public JSSImplementation() throws ClassNotFoundException { Class.forName(SSLSocketClass); try { Class factcl = Class.forName(JSSFactory); factory = (JSSFactory) factcl.newInstance(); } catch (Exception e) { logger.error("Error getting factory: " + JSSFactory, e); } } public String getImplementationName() { return "JSS"; } public ServerSocketFactory getServerSocketFactory(AbstractEndpoint endpoint) { Properties config = new Properties(); try { String configFile = System.getProperty("catalina.base") + "/conf/tomcatjss.conf"; config.load(new FileReader(configFile)); } catch (FileNotFoundException e) { // ignore } catch (IOException e) { throw new RuntimeException(e); } return factory.getSocketFactory(endpoint, config); } public SSLSupport getSSLSupport(Socket s) { SSLSupport ssls = null; ssls = factory.getSSLSupport(s); return ssls; } public SSLSupport getSSLSupport(javax.net.ssl.SSLSession session) { /* * The Tomcat 6.0.26 docs says: This method has been deprecated since it * adds a JSSE dependency to this interface. It will be removed in * versions after 6.0.x. * * But we have to provide a implementation of this method because it's * declared as abstract. * * Unfortunately there does not appear to be any way to get SSLSupport * information from a session with JSS. JSS looks up the information * based on a socket, not a session. This done in SSLSocket.c * Java_org_mozilla_jss_ssl_SSLSocket_getStatus(). * * So while it would be nice to provide a working implmentation there * doesn't seem to be an easy way to do this. Given that this method is * already deprecated and there hasn't been any evidence of it being * called it therefore seems reasonable to just return null to satify * the compiler's demand for an implementation. * * Once this abstract method is removed from SSLImplementation in a * future release we can remove this stub. * * NOTE: This method has NOT yet been deprecated in Tomcat 7! */ return null; } public SSLUtil getSSLUtil(AbstractEndpoint endpoint) { return null; } } tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/util/net/jss/JSSSocketFactory.java000066400000000000000000000231561350024045500277630ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; import java.util.Properties; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; // Imports required to "implement" Tomcat 7 Interface import org.apache.tomcat.util.net.AbstractEndpoint; import org.mozilla.jss.ssl.SSLServerSocket; import org.mozilla.jss.ssl.SSLSocket; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JSSSocketFactory implements org.apache.tomcat.util.net.ServerSocketFactory, org.apache.tomcat.util.net.SSLUtil { public static Logger logger = LoggerFactory.getLogger(JSSSocketFactory.class); TomcatJSS tomcatjss = TomcatJSS.getInstance(); private AbstractEndpoint endpoint; private Properties config; public JSSSocketFactory(AbstractEndpoint endpoint) { this(endpoint, null); } public JSSSocketFactory(AbstractEndpoint endpoint, Properties config) { this.endpoint = endpoint; this.config = config; try { init(); } catch (IOException e) { throw new RuntimeException(e); } } String getProperty(String tag) { // check /conf/server.xml String value = (String)endpoint.getAttribute(tag); // if not available, check /conf/tomcatjss.conf if (value == null) { value = config.getProperty(tag); } return value; } String getProperty(String tag, String defaultValue) { String value = getProperty(tag); if (value == null) { return defaultValue; } return value; } void init() throws IOException { try { String certdbDir = getProperty("certdbDir"); tomcatjss.setCertdbDir(certdbDir); String passwordClass = getProperty("passwordClass"); tomcatjss.setPasswordClass(passwordClass); String passwordFile = getProperty("passwordFile"); tomcatjss.setPasswordFile(passwordFile); String serverCertNickFile = getProperty("serverCertNickFile"); tomcatjss.setServerCertNickFile(serverCertNickFile); // MUST look for "clientauth" (ALL lowercase) since "clientAuth" // (camel case) has already been processed by Tomcat 7 String clientAuth = getProperty("clientauth"); if (clientAuth != null) { tomcatjss.setClientAuth(clientAuth); } String strEnableOCSP = getProperty("enableOCSP"); boolean enableOCSP = Boolean.parseBoolean(strEnableOCSP); tomcatjss.setEnableOCSP(enableOCSP); String ocspResponderURL = getProperty("ocspResponderURL"); tomcatjss.setOcspResponderURL(ocspResponderURL); String ocspResponderCertNickname = getProperty("ocspResponderCertNickname"); tomcatjss.setOcspResponderCertNickname(ocspResponderCertNickname); String strOcspCacheSize = getProperty("ocspCacheSize"); if (strOcspCacheSize != null) { int ocspCacheSize = Integer.parseInt(strOcspCacheSize); tomcatjss.setOcspCacheSize(ocspCacheSize); } String strOcspMinCacheEntryDuration = getProperty("ocspMinCacheEntryDuration"); if (strOcspMinCacheEntryDuration != null) { int ocspMinCacheEntryDuration = Integer.parseInt(strOcspMinCacheEntryDuration); tomcatjss.setOcspMinCacheEntryDuration(ocspMinCacheEntryDuration); } String strOcspMaxCacheEntryDuration = getProperty("ocspMaxCacheEntryDuration"); if (strOcspMaxCacheEntryDuration != null) { int ocspMaxCacheEntryDuration = Integer.parseInt(strOcspMaxCacheEntryDuration); tomcatjss.setOcspMaxCacheEntryDuration(ocspMaxCacheEntryDuration); } String strOcspTimeout = getProperty("ocspTimeout"); if (strOcspTimeout != null) { int ocspTimeout = Integer.parseInt(strOcspTimeout); tomcatjss.setOcspTimeout(ocspTimeout); } String strictCiphers = getProperty("strictCiphers"); tomcatjss.setStrictCiphers(strictCiphers); String sslVersionRangeStream = getProperty("sslVersionRangeStream"); tomcatjss.setSslVersionRangeStream(sslVersionRangeStream); String sslVersionRangeDatagram = getProperty("sslVersionRangeDatagram"); tomcatjss.setSslVersionRangeDatagram(sslVersionRangeDatagram); String sslRangeCiphers = getProperty("sslRangeCiphers"); tomcatjss.setSslRangeCiphers(sslRangeCiphers); String sslOptions = getProperty("sslOptions"); tomcatjss.setSslOptions(sslOptions); String ssl2Ciphers = getProperty("ssl2Ciphers"); tomcatjss.setSsl2Ciphers(ssl2Ciphers); String ssl3Ciphers = getProperty("ssl3Ciphers"); tomcatjss.setSsl3Ciphers(ssl3Ciphers); String tlsCiphers = getProperty("tlsCiphers"); tomcatjss.setTlsCiphers(tlsCiphers); tomcatjss.init(); } catch (Exception ex) { logger.error("JSSSocketFactory: " + ex); // The idea is, if admin take the trouble to configure the // ocsp cache, and made a mistake, we want to make server // unavailable until they get it right if ((ex instanceof java.security.GeneralSecurityException) || (ex instanceof java.lang.NumberFormatException)) throw new IOException(ex); } } public Socket acceptSocket(ServerSocket socket) throws IOException { SSLSocket asock = null; try { asock = (SSLSocket) socket.accept(); asock.addSocketListener(tomcatjss); if (tomcatjss.getRequireClientAuth() || tomcatjss.getWantClientAuth()) { asock.requestClientAuth(true); if (tomcatjss.getRequireClientAuth()) { asock.requireClientAuth(SSLSocket.SSL_REQUIRE_ALWAYS); } else { asock.requireClientAuth(SSLSocket.SSL_REQUIRE_NEVER); } } } catch (Exception e) { throw new SocketException("SSL handshake error " + e.toString()); } return asock; } public void handshake(Socket sock) throws IOException { // ((SSLSocket)sock).forceHandshake(); } public ServerSocket createSocket(int port) throws IOException { return createSocket(port, SSLServerSocket.DEFAULT_BACKLOG, null); } public ServerSocket createSocket(int port, int backlog) throws IOException { return createSocket(port, backlog, null); } public ServerSocket createSocket(int port, int backlog, InetAddress ifAddress) throws IOException { return createSocket(port, backlog, ifAddress, true); } public ServerSocket createSocket(int port, int backlog, InetAddress ifAddress, boolean reuseAddr) throws IOException { SSLServerSocket socket = null; socket = new SSLServerSocket(port, backlog, ifAddress, null, reuseAddr); initializeSocket(socket); return socket; } private void initializeSocket(SSLServerSocket s) { try { /* * Timeout's should not be enabled by default. Upper layers will * call setSoTimeout() as needed. Zero means disable. */ s.setSoTimeout(0); if (tomcatjss.getRequireClientAuth() || tomcatjss.getWantClientAuth()) { s.requestClientAuth(true); if (tomcatjss.getRequireClientAuth()) { s.requireClientAuth(SSLSocket.SSL_REQUIRE_ALWAYS); } else { s.requireClientAuth(SSLSocket.SSL_REQUIRE_NEVER); } } String serverCertNick = tomcatjss.getServerCertNick(); s.setServerCertNickname(serverCertNick); } catch (Exception e) { } } // Methods required to "implement" Tomcat 7 Interface public SSLContext createSSLContext() throws Exception { return null; } public KeyManager[] getKeyManagers() throws Exception { return null; } public TrustManager[] getTrustManagers() throws Exception { return null; } public void configureSessionContext( javax.net.ssl.SSLSessionContext sslSessionContext) { return; } public String[] getEnableableCiphers(SSLContext context) { return null; } public String[] getEnableableProtocols(SSLContext context) { return null; } } tomcatjss-7.4.1/tomcat-7.0/src/org/apache/tomcat/util/net/jss/JSSSupport.java000066400000000000000000000066351350024045500266620ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import org.apache.tomcat.util.net.SSLSupport; import org.mozilla.jss.ssl.SSLSecurityStatus; import org.mozilla.jss.ssl.SSLSocket; class JSSSupport implements SSLSupport { private SSLSocket ssl = null; private SSLSecurityStatus status = null; JSSSupport(SSLSocket sock) { ssl = sock; try { status = ssl.getStatus(); } catch (IOException e) { } } public X509Certificate[] getPeerCertificateChain(boolean force) throws IOException { // retrieve the status when we need it. status cache // the client certificate which may not be available // at the creation of JSSSupport status = ssl.getStatus(); if (status != null) { org.mozilla.jss.crypto.X509Certificate peerCert = status .getPeerCertificate(); if (peerCert == null) { ssl.requireClientAuth(SSLSocket.SSL_REQUIRE_NO_ERROR); try { ssl.redoHandshake(); ssl.forceHandshake(); } catch (Exception e) { } status = ssl.getStatus(); peerCert = status.getPeerCertificate(); } if (peerCert != null) { X509Certificate[] certs = new X509Certificate[1]; try { byte[] b = peerCert.getEncoded(); CertificateFactory cf = CertificateFactory .getInstance("X.509"); ByteArrayInputStream stream = new ByteArrayInputStream(b); certs[0] = (X509Certificate) cf.generateCertificate(stream); } catch (Exception e) { } return certs; } } return null; } public Object[] getPeerCertificateChain() throws IOException { return getPeerCertificateChain(false); } public String getCipherSuite() throws IOException { if (status != null) return status.getCipher(); return null; } public Integer getKeySize() throws IOException { if (status != null) return (new Integer(status.getSessionKeySize())); return null; } public String getProtocol() throws IOException { return null; } public String getSessionId() throws IOException { return null; } } tomcatjss-7.4.1/tomcat-7.0/src/org/dogtagpki/000077500000000000000000000000001350024045500206505ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/dogtagpki/tomcat/000077500000000000000000000000001350024045500221375ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-7.0/src/org/dogtagpki/tomcat/Http11Protocol.java000066400000000000000000000122461350024045500256120ustar00rootroot00000000000000package org.dogtagpki.tomcat; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.logging.Logger; import org.apache.tomcat.util.net.jss.TomcatJSS; public class Http11Protocol extends org.apache.coyote.http11.Http11Protocol { final static Logger logger = Logger.getLogger(Http11Protocol.class.getName()); TomcatJSS tomcatjss = TomcatJSS.getInstance(); public String getCertdbDir() { return tomcatjss.getCertdbDir(); } public void setCertdbDir(String certdbDir) { tomcatjss.setCertdbDir(certdbDir); } public String getPasswordClass() { return tomcatjss.getPasswordClass(); } public void setPasswordClass(String passwordClass) { tomcatjss.setPasswordClass(passwordClass); } public String getPasswordFile() { return tomcatjss.getPasswordFile(); } public void setPasswordFile(String passwordFile) { tomcatjss.setPasswordFile(passwordFile); } public String getServerCertNickFile() { return tomcatjss.getServerCertNickFile(); } public void setServerCertNickFile(String serverCertNickFile) { tomcatjss.setServerCertNickFile(serverCertNickFile); } public boolean getEnabledOCSP() { return tomcatjss.getEnableOCSP(); } public void setEnableOCSP(boolean enableOCSP) { tomcatjss.setEnableOCSP(enableOCSP); } public String getOcspResponderURL() { return tomcatjss.getOcspResponderURL(); } public void setOcspResponderURL(String ocspResponderURL) { tomcatjss.setOcspResponderURL(ocspResponderURL); } public String getOcspResponderCertNickname() { return tomcatjss.getOcspResponderCertNickname(); } public void setOcspResponderCertNickname(String ocspResponderCertNickname) { tomcatjss.setOcspResponderCertNickname(ocspResponderCertNickname); } public int getOcspCacheSize() { return tomcatjss.getOcspCacheSize(); } public void setOcspCacheSize(int ocspCacheSize) { tomcatjss.setOcspCacheSize(ocspCacheSize); } public int getOcspMinCacheEntryDuration() { return tomcatjss.getOcspMinCacheEntryDuration(); } public void setOcspMinCacheEntryDuration(int ocspMinCacheEntryDuration) { tomcatjss.setOcspMinCacheEntryDuration(ocspMinCacheEntryDuration); } public int getOcspMaxCacheEntryDuration() { return tomcatjss.getOcspMaxCacheEntryDuration(); } public void setOcspMaxCacheEntryDuration(int ocspMaxCacheEntryDuration) { tomcatjss.setOcspMaxCacheEntryDuration(ocspMaxCacheEntryDuration); } public int getOcspTimeout() { return tomcatjss.getOcspTimeout(); } public void setOcspTimeout(int ocspTimeout) { tomcatjss.setOcspTimeout(ocspTimeout); } public String getStrictCiphers() { return tomcatjss.getStrictCiphers(); } public void setStrictCiphers(String strictCiphers) { tomcatjss.setStrictCiphers(strictCiphers); } public String getSslVersionRangeStream() { return tomcatjss.getSslVersionRangeStream(); } public void setSslVersionRangeStream(String sslVersionRangeStream) { tomcatjss.setSslVersionRangeStream(sslVersionRangeStream); } public String getSslVersionRangeDatagram() { return tomcatjss.getSslVersionRangeDatagram(); } public void setSslVersionRangeDatagram(String sslVersionRangeDatagram) { tomcatjss.setSslVersionRangeDatagram(sslVersionRangeDatagram);; } public String getSslRangeCiphers() { return tomcatjss.getSslRangeCiphers(); } public void setSslRangeCiphers(String sslRangeCiphers) { tomcatjss.setSslRangeCiphers(sslRangeCiphers); } public String getSslOptions() { return tomcatjss.getSslOptions(); } public void setSslOptions(String sslOptions) { tomcatjss.setSslOptions(sslOptions); } public String getSsl2Ciphers() { return tomcatjss.getSsl2Ciphers(); } public void setSsl2Ciphers(String ssl2Ciphers) { tomcatjss.setSsl2Ciphers(ssl2Ciphers); } public String getSsl3Ciphers() { return tomcatjss.getSsl3Ciphers(); } public void setSsl3Ciphers(String ssl3Ciphers) { tomcatjss.setSsl3Ciphers(ssl3Ciphers); } public String getTlsCiphers() { return tomcatjss.getTlsCiphers(); } public void setTlsCiphers(String tlsCiphers) { tomcatjss.setTlsCiphers(tlsCiphers); } public void setKeystorePassFile(String keystorePassFile) { try { Path path = Paths.get(keystorePassFile); String password = new String(Files.readAllBytes(path)).trim(); setKeystorePass(password); } catch (IOException e) { throw new RuntimeException(e); } } public void setTruststorePassFile(String truststorePassFile) { try { Path path = Paths.get(truststorePassFile); String password = new String(Files.readAllBytes(path)).trim(); setTruststorePass(password); } catch (IOException e) { throw new RuntimeException(e); } } } tomcatjss-7.4.1/tomcat-8.0/000077500000000000000000000000001350024045500153225ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/000077500000000000000000000000001350024045500161115ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/000077500000000000000000000000001350024045500167005ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/apache/000077500000000000000000000000001350024045500201215ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/000077500000000000000000000000001350024045500214105ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/util/000077500000000000000000000000001350024045500223655ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/util/net/000077500000000000000000000000001350024045500231535ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/util/net/jss/000077500000000000000000000000001350024045500237525ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/util/net/jss/IJSSFactory.java000066400000000000000000000024021350024045500267130ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.net.Socket; import java.util.Properties; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.SSLSupport; import org.apache.tomcat.util.net.ServerSocketFactory; interface IJSSFactory { public ServerSocketFactory getSocketFactory(AbstractEndpoint endpoint, Properties config); public SSLSupport getSSLSupport(Socket socket); } tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/util/net/jss/JSSFactory.java000066400000000000000000000027141350024045500266100ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.net.Socket; import java.util.Properties; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.SSLSupport; import org.apache.tomcat.util.net.ServerSocketFactory; import org.mozilla.jss.ssl.SSLSocket; class JSSFactory implements IJSSFactory { JSSFactory() { } public ServerSocketFactory getSocketFactory(AbstractEndpoint endpoint, Properties config) { return new JSSSocketFactory(endpoint, config); } public SSLSupport getSSLSupport(Socket socket) { return new JSSSupport((SSLSocket) socket); } } tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/util/net/jss/JSSImplementation.java000066400000000000000000000101501350024045500301570ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.net.Socket; import java.util.Properties; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.SSLImplementation; import org.apache.tomcat.util.net.SSLSupport; import org.apache.tomcat.util.net.SSLUtil; import org.apache.tomcat.util.net.ServerSocketFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JSSImplementation extends SSLImplementation { public static Logger logger = LoggerFactory.getLogger(JSSImplementation.class); static final String JSSFactory = "org.apache.tomcat.util.net.jss.JSSFactory"; static final String SSLSocketClass = "org.mozilla.jss.ssl.SSLSocket"; private JSSFactory factory = null; public JSSImplementation() throws ClassNotFoundException { Class.forName(SSLSocketClass); try { Class factcl = Class.forName(JSSFactory); factory = (JSSFactory) factcl.newInstance(); } catch (Exception e) { logger.error("Error getting factory: " + JSSFactory, e); } } public String getImplementationName() { return "JSS"; } public ServerSocketFactory getServerSocketFactory(AbstractEndpoint endpoint) { Properties config = new Properties(); try { String configFile = System.getProperty("catalina.base") + "/conf/tomcatjss.conf"; config.load(new FileReader(configFile)); } catch (FileNotFoundException e) { // ignore } catch (IOException e) { throw new RuntimeException(e); } return factory.getSocketFactory(endpoint, config); } public SSLSupport getSSLSupport(Socket s) { SSLSupport ssls = null; ssls = factory.getSSLSupport(s); return ssls; } public SSLSupport getSSLSupport(javax.net.ssl.SSLSession session) { /* * The Tomcat 6.0.26 docs says: This method has been deprecated since it * adds a JSSE dependency to this interface. It will be removed in * versions after 6.0.x. * * But we have to provide a implementation of this method because it's * declared as abstract. * * Unfortunately there does not appear to be any way to get SSLSupport * information from a session with JSS. JSS looks up the information * based on a socket, not a session. This done in SSLSocket.c * Java_org_mozilla_jss_ssl_SSLSocket_getStatus(). * * So while it would be nice to provide a working implmentation there * doesn't seem to be an easy way to do this. Given that this method is * already deprecated and there hasn't been any evidence of it being * called it therefore seems reasonable to just return null to satify * the compiler's demand for an implementation. * * Once this abstract method is removed from SSLImplementation in a * future release we can remove this stub. * * NOTE: This method has NOT yet been deprecated in Tomcat 7! */ return null; } public SSLUtil getSSLUtil(AbstractEndpoint endpoint) { return null; } } tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/util/net/jss/JSSSocketFactory.java000066400000000000000000000231561350024045500277640ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; import java.util.Properties; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; // Imports required to "implement" Tomcat 7 Interface import org.apache.tomcat.util.net.AbstractEndpoint; import org.mozilla.jss.ssl.SSLServerSocket; import org.mozilla.jss.ssl.SSLSocket; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JSSSocketFactory implements org.apache.tomcat.util.net.ServerSocketFactory, org.apache.tomcat.util.net.SSLUtil { public static Logger logger = LoggerFactory.getLogger(JSSSocketFactory.class); TomcatJSS tomcatjss = TomcatJSS.getInstance(); private AbstractEndpoint endpoint; private Properties config; public JSSSocketFactory(AbstractEndpoint endpoint) { this(endpoint, null); } public JSSSocketFactory(AbstractEndpoint endpoint, Properties config) { this.endpoint = endpoint; this.config = config; try { init(); } catch (IOException e) { throw new RuntimeException(e); } } String getProperty(String tag) { // check /conf/server.xml String value = (String)endpoint.getAttribute(tag); // if not available, check /conf/tomcatjss.conf if (value == null) { value = config.getProperty(tag); } return value; } String getProperty(String tag, String defaultValue) { String value = getProperty(tag); if (value == null) { return defaultValue; } return value; } void init() throws IOException { try { String certdbDir = getProperty("certdbDir"); tomcatjss.setCertdbDir(certdbDir); String passwordClass = getProperty("passwordClass"); tomcatjss.setPasswordClass(passwordClass); String passwordFile = getProperty("passwordFile"); tomcatjss.setPasswordFile(passwordFile); String serverCertNickFile = getProperty("serverCertNickFile"); tomcatjss.setServerCertNickFile(serverCertNickFile); // MUST look for "clientauth" (ALL lowercase) since "clientAuth" // (camel case) has already been processed by Tomcat 7 String clientAuth = getProperty("clientauth"); if (clientAuth != null) { tomcatjss.setClientAuth(clientAuth); } String strEnableOCSP = getProperty("enableOCSP"); boolean enableOCSP = Boolean.parseBoolean(strEnableOCSP); tomcatjss.setEnableOCSP(enableOCSP); String ocspResponderURL = getProperty("ocspResponderURL"); tomcatjss.setOcspResponderURL(ocspResponderURL); String ocspResponderCertNickname = getProperty("ocspResponderCertNickname"); tomcatjss.setOcspResponderCertNickname(ocspResponderCertNickname); String strOcspCacheSize = getProperty("ocspCacheSize"); if (strOcspCacheSize != null) { int ocspCacheSize = Integer.parseInt(strOcspCacheSize); tomcatjss.setOcspCacheSize(ocspCacheSize); } String strOcspMinCacheEntryDuration = getProperty("ocspMinCacheEntryDuration"); if (strOcspMinCacheEntryDuration != null) { int ocspMinCacheEntryDuration = Integer.parseInt(strOcspMinCacheEntryDuration); tomcatjss.setOcspMinCacheEntryDuration(ocspMinCacheEntryDuration); } String strOcspMaxCacheEntryDuration = getProperty("ocspMaxCacheEntryDuration"); if (strOcspMaxCacheEntryDuration != null) { int ocspMaxCacheEntryDuration = Integer.parseInt(strOcspMaxCacheEntryDuration); tomcatjss.setOcspMaxCacheEntryDuration(ocspMaxCacheEntryDuration); } String strOcspTimeout = getProperty("ocspTimeout"); if (strOcspTimeout != null) { int ocspTimeout = Integer.parseInt(strOcspTimeout); tomcatjss.setOcspTimeout(ocspTimeout); } String strictCiphers = getProperty("strictCiphers"); tomcatjss.setStrictCiphers(strictCiphers); String sslVersionRangeStream = getProperty("sslVersionRangeStream"); tomcatjss.setSslVersionRangeStream(sslVersionRangeStream); String sslVersionRangeDatagram = getProperty("sslVersionRangeDatagram"); tomcatjss.setSslVersionRangeDatagram(sslVersionRangeDatagram); String sslRangeCiphers = getProperty("sslRangeCiphers"); tomcatjss.setSslRangeCiphers(sslRangeCiphers); String sslOptions = getProperty("sslOptions"); tomcatjss.setSslOptions(sslOptions); String ssl2Ciphers = getProperty("ssl2Ciphers"); tomcatjss.setSsl2Ciphers(ssl2Ciphers); String ssl3Ciphers = getProperty("ssl3Ciphers"); tomcatjss.setSsl3Ciphers(ssl3Ciphers); String tlsCiphers = getProperty("tlsCiphers"); tomcatjss.setTlsCiphers(tlsCiphers); tomcatjss.init(); } catch (Exception ex) { logger.error("JSSSocketFactory: " + ex); // The idea is, if admin take the trouble to configure the // ocsp cache, and made a mistake, we want to make server // unavailable until they get it right if ((ex instanceof java.security.GeneralSecurityException) || (ex instanceof java.lang.NumberFormatException)) throw new IOException(ex); } } public Socket acceptSocket(ServerSocket socket) throws IOException { SSLSocket asock = null; try { asock = (SSLSocket) socket.accept(); asock.addSocketListener(tomcatjss); if (tomcatjss.getRequireClientAuth() || tomcatjss.getWantClientAuth()) { asock.requestClientAuth(true); if (tomcatjss.getRequireClientAuth()) { asock.requireClientAuth(SSLSocket.SSL_REQUIRE_ALWAYS); } else { asock.requireClientAuth(SSLSocket.SSL_REQUIRE_NEVER); } } } catch (Exception e) { throw new SocketException("SSL handshake error " + e.toString()); } return asock; } public void handshake(Socket sock) throws IOException { // ((SSLSocket)sock).forceHandshake(); } public ServerSocket createSocket(int port) throws IOException { return createSocket(port, SSLServerSocket.DEFAULT_BACKLOG, null); } public ServerSocket createSocket(int port, int backlog) throws IOException { return createSocket(port, backlog, null); } public ServerSocket createSocket(int port, int backlog, InetAddress ifAddress) throws IOException { return createSocket(port, backlog, ifAddress, true); } public ServerSocket createSocket(int port, int backlog, InetAddress ifAddress, boolean reuseAddr) throws IOException { SSLServerSocket socket = null; socket = new SSLServerSocket(port, backlog, ifAddress, null, reuseAddr); initializeSocket(socket); return socket; } private void initializeSocket(SSLServerSocket s) { try { /* * Timeout's should not be enabled by default. Upper layers will * call setSoTimeout() as needed. Zero means disable. */ s.setSoTimeout(0); if (tomcatjss.getRequireClientAuth() || tomcatjss.getWantClientAuth()) { s.requestClientAuth(true); if (tomcatjss.getRequireClientAuth()) { s.requireClientAuth(SSLSocket.SSL_REQUIRE_ALWAYS); } else { s.requireClientAuth(SSLSocket.SSL_REQUIRE_NEVER); } } String serverCertNick = tomcatjss.getServerCertNick(); s.setServerCertNickname(serverCertNick); } catch (Exception e) { } } // Methods required to "implement" Tomcat 7 Interface public SSLContext createSSLContext() throws Exception { return null; } public KeyManager[] getKeyManagers() throws Exception { return null; } public TrustManager[] getTrustManagers() throws Exception { return null; } public void configureSessionContext( javax.net.ssl.SSLSessionContext sslSessionContext) { return; } public String[] getEnableableCiphers(SSLContext context) { return null; } public String[] getEnableableProtocols(SSLContext context) { return null; } } tomcatjss-7.4.1/tomcat-8.0/src/org/apache/tomcat/util/net/jss/JSSSupport.java000066400000000000000000000066351350024045500266630ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.apache.tomcat.util.net.jss; import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import org.apache.tomcat.util.net.SSLSupport; import org.mozilla.jss.ssl.SSLSecurityStatus; import org.mozilla.jss.ssl.SSLSocket; class JSSSupport implements SSLSupport { private SSLSocket ssl = null; private SSLSecurityStatus status = null; JSSSupport(SSLSocket sock) { ssl = sock; try { status = ssl.getStatus(); } catch (IOException e) { } } public X509Certificate[] getPeerCertificateChain(boolean force) throws IOException { // retrieve the status when we need it. status cache // the client certificate which may not be available // at the creation of JSSSupport status = ssl.getStatus(); if (status != null) { org.mozilla.jss.crypto.X509Certificate peerCert = status .getPeerCertificate(); if (peerCert == null) { ssl.requireClientAuth(SSLSocket.SSL_REQUIRE_NO_ERROR); try { ssl.redoHandshake(); ssl.forceHandshake(); } catch (Exception e) { } status = ssl.getStatus(); peerCert = status.getPeerCertificate(); } if (peerCert != null) { X509Certificate[] certs = new X509Certificate[1]; try { byte[] b = peerCert.getEncoded(); CertificateFactory cf = CertificateFactory .getInstance("X.509"); ByteArrayInputStream stream = new ByteArrayInputStream(b); certs[0] = (X509Certificate) cf.generateCertificate(stream); } catch (Exception e) { } return certs; } } return null; } public Object[] getPeerCertificateChain() throws IOException { return getPeerCertificateChain(false); } public String getCipherSuite() throws IOException { if (status != null) return status.getCipher(); return null; } public Integer getKeySize() throws IOException { if (status != null) return (new Integer(status.getSessionKeySize())); return null; } public String getProtocol() throws IOException { return null; } public String getSessionId() throws IOException { return null; } } tomcatjss-7.4.1/tomcat-8.0/src/org/dogtagpki/000077500000000000000000000000001350024045500206515ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/dogtagpki/tomcat/000077500000000000000000000000001350024045500221405ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.0/src/org/dogtagpki/tomcat/Http11Protocol.java000066400000000000000000000122741350024045500256140ustar00rootroot00000000000000package org.dogtagpki.tomcat; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import org.apache.tomcat.util.net.jss.TomcatJSS; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Http11Protocol extends org.apache.coyote.http11.Http11Protocol { public static Logger logger = LoggerFactory.getLogger(Http11Protocol.class); TomcatJSS tomcatjss = TomcatJSS.getInstance(); public String getCertdbDir() { return tomcatjss.getCertdbDir(); } public void setCertdbDir(String certdbDir) { tomcatjss.setCertdbDir(certdbDir); } public String getPasswordClass() { return tomcatjss.getPasswordClass(); } public void setPasswordClass(String passwordClass) { tomcatjss.setPasswordClass(passwordClass); } public String getPasswordFile() { return tomcatjss.getPasswordFile(); } public void setPasswordFile(String passwordFile) { tomcatjss.setPasswordFile(passwordFile); } public String getServerCertNickFile() { return tomcatjss.getServerCertNickFile(); } public void setServerCertNickFile(String serverCertNickFile) { tomcatjss.setServerCertNickFile(serverCertNickFile); } public boolean getEnabledOCSP() { return tomcatjss.getEnableOCSP(); } public void setEnableOCSP(boolean enableOCSP) { tomcatjss.setEnableOCSP(enableOCSP); } public String getOcspResponderURL() { return tomcatjss.getOcspResponderURL(); } public void setOcspResponderURL(String ocspResponderURL) { tomcatjss.setOcspResponderURL(ocspResponderURL); } public String getOcspResponderCertNickname() { return tomcatjss.getOcspResponderCertNickname(); } public void setOcspResponderCertNickname(String ocspResponderCertNickname) { tomcatjss.setOcspResponderCertNickname(ocspResponderCertNickname); } public int getOcspCacheSize() { return tomcatjss.getOcspCacheSize(); } public void setOcspCacheSize(int ocspCacheSize) { tomcatjss.setOcspCacheSize(ocspCacheSize); } public int getOcspMinCacheEntryDuration() { return tomcatjss.getOcspMinCacheEntryDuration(); } public void setOcspMinCacheEntryDuration(int ocspMinCacheEntryDuration) { tomcatjss.setOcspMinCacheEntryDuration(ocspMinCacheEntryDuration); } public int getOcspMaxCacheEntryDuration() { return tomcatjss.getOcspMaxCacheEntryDuration(); } public void setOcspMaxCacheEntryDuration(int ocspMaxCacheEntryDuration) { tomcatjss.setOcspMaxCacheEntryDuration(ocspMaxCacheEntryDuration); } public int getOcspTimeout() { return tomcatjss.getOcspTimeout(); } public void setOcspTimeout(int ocspTimeout) { tomcatjss.setOcspTimeout(ocspTimeout); } public String getStrictCiphers() { return tomcatjss.getStrictCiphers(); } public void setStrictCiphers(String strictCiphers) { tomcatjss.setStrictCiphers(strictCiphers); } public String getSslVersionRangeStream() { return tomcatjss.getSslVersionRangeStream(); } public void setSslVersionRangeStream(String sslVersionRangeStream) { tomcatjss.setSslVersionRangeStream(sslVersionRangeStream); } public String getSslVersionRangeDatagram() { return tomcatjss.getSslVersionRangeDatagram(); } public void setSslVersionRangeDatagram(String sslVersionRangeDatagram) { tomcatjss.setSslVersionRangeDatagram(sslVersionRangeDatagram);; } public String getSslRangeCiphers() { return tomcatjss.getSslRangeCiphers(); } public void setSslRangeCiphers(String sslRangeCiphers) { tomcatjss.setSslRangeCiphers(sslRangeCiphers); } public String getSslOptions() { return tomcatjss.getSslOptions(); } public void setSslOptions(String sslOptions) { tomcatjss.setSslOptions(sslOptions); } public String getSsl2Ciphers() { return tomcatjss.getSsl2Ciphers(); } public void setSsl2Ciphers(String ssl2Ciphers) { tomcatjss.setSsl2Ciphers(ssl2Ciphers); } public String getSsl3Ciphers() { return tomcatjss.getSsl3Ciphers(); } public void setSsl3Ciphers(String ssl3Ciphers) { tomcatjss.setSsl3Ciphers(ssl3Ciphers); } public String getTlsCiphers() { return tomcatjss.getTlsCiphers(); } public void setTlsCiphers(String tlsCiphers) { tomcatjss.setTlsCiphers(tlsCiphers); } public void setKeystorePassFile(String keystorePassFile) { try { Path path = Paths.get(keystorePassFile); String password = new String(Files.readAllBytes(path)).trim(); setKeystorePass(password); } catch (IOException e) { throw new RuntimeException(e); } } public void setTruststorePassFile(String truststorePassFile) { try { Path path = Paths.get(truststorePassFile); String password = new String(Files.readAllBytes(path)).trim(); setTruststorePass(password); } catch (IOException e) { throw new RuntimeException(e); } } } tomcatjss-7.4.1/tomcat-8.5/000077500000000000000000000000001350024045500153275ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.5/src/000077500000000000000000000000001350024045500161165ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.5/src/org/000077500000000000000000000000001350024045500167055ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.5/src/org/dogtagpki/000077500000000000000000000000001350024045500206565ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.5/src/org/dogtagpki/tomcat/000077500000000000000000000000001350024045500221455ustar00rootroot00000000000000tomcatjss-7.4.1/tomcat-8.5/src/org/dogtagpki/tomcat/JSSImplementation.java000066400000000000000000000041151350024045500263560ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.dogtagpki.tomcat; import org.apache.tomcat.util.net.SSLHostConfig; import org.apache.tomcat.util.net.SSLHostConfigCertificate; import org.apache.tomcat.util.net.SSLUtil; import org.apache.tomcat.util.net.jsse.JSSEImplementation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JSSImplementation extends JSSEImplementation { public static Logger logger = LoggerFactory.getLogger(JSSUtil.class); public JSSImplementation() { logger.debug("JSSImplementation: instance created"); } @Override public SSLUtil getSSLUtil(SSLHostConfigCertificate cert) { logger.debug("JSSImplementation: getSSLUtil()"); logger.debug("JSSImplementation: key alias: " + cert.getCertificateKeyAlias()); logger.debug("JSSImplementation: keystore provider: " + cert.getCertificateKeystoreProvider()); SSLHostConfig hostConfig = cert.getSSLHostConfig(); logger.debug("JSSImplementation: key manager alg: " + hostConfig.getKeyManagerAlgorithm()); logger.debug("JSSImplementation: truststore alg: " + hostConfig.getTruststoreAlgorithm()); logger.debug("JSSImplementation: truststore provider: " + hostConfig.getTruststoreProvider()); return new JSSUtil(cert); } } tomcatjss-7.4.1/tomcat-8.5/src/org/dogtagpki/tomcat/JSSUtil.java000066400000000000000000000036401350024045500243100ustar00rootroot00000000000000/* BEGIN COPYRIGHT BLOCK * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2018 Red Hat, Inc. * All rights reserved. * END COPYRIGHT BLOCK */ package org.dogtagpki.tomcat; import javax.net.ssl.KeyManager; import javax.net.ssl.TrustManager; import org.apache.tomcat.util.net.SSLHostConfigCertificate; import org.apache.tomcat.util.net.jsse.JSSEKeyManager; import org.apache.tomcat.util.net.jsse.JSSEUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class JSSUtil extends JSSEUtil { public static Logger logger = LoggerFactory.getLogger(JSSUtil.class); public JSSUtil(SSLHostConfigCertificate cert) { super(cert); logger.debug("JSSUtil: instance created"); } @Override public KeyManager[] getKeyManagers() throws Exception { logger.debug("JSSUtil: getKeyManagers()"); String keyAlias = certificate.getCertificateKeyAlias(); KeyManager keyManager = new JSSEKeyManager(new JSSKeyManager(), keyAlias); return new KeyManager[] { keyManager }; } @Override public TrustManager[] getTrustManagers() throws Exception { logger.debug("JSSUtil: getTrustManagers()"); return new TrustManager[] { new JSSTrustManager() }; } } tomcatjss-7.4.1/tomcatjss.spec000066400000000000000000000125511350024045500164170ustar00rootroot00000000000000################################################################################ Name: tomcatjss ################################################################################ Summary: JSS Connector for Apache Tomcat URL: http://www.dogtagpki.org/wiki/TomcatJSS License: LGPLv2+ BuildArch: noarch Version: 7.4.1 Release: 1%{?_timestamp}%{?_commit_id}%{?dist} # global _phase -a1 # To generate the source tarball: # $ git clone https://github.com/dogtagpki/tomcatjss.git # $ cd tomcatjss # $ git archive \ # --format=tar.gz \ # --prefix tomcatjss-VERSION/ \ # -o tomcatjss-VERSION.tar.gz \ # Source: https://github.com/dogtagpki/tomcatjss/archive/v%{version}%{?_phase}/tomcatjss-%{version}%{?_phase}.tar.gz # To create a patch for all changes since a version tag: # $ git format-patch \ # --stdout \ # \ # > tomcatjss-VERSION-RELEASE.patch # Patch: tomcatjss-VERSION-RELEASE.patch ################################################################################ # Build Dependencies ################################################################################ # jpackage-utils requires versioning to meet both build and runtime requirements # jss requires versioning to meet both build and runtime requirements # tomcat requires versioning to meet both build and runtime requirements # autosetup BuildRequires: git # Java BuildRequires: ant BuildRequires: apache-commons-lang BuildRequires: java-devel BuildRequires: jpackage-utils >= 0:1.7.5-15 # SLF4J BuildRequires: slf4j %if 0%{?rhel} && 0%{?rhel} <= 7 # no slf4j-jdk14 %else BuildRequires: slf4j-jdk14 %endif # JSS %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: jss >= 4.4.0-7 %else BuildRequires: jss >= 4.5.3 %endif # Tomcat %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: tomcat >= 7.0.69 %else %if 0%{?fedora} && 0%{?fedora} <= 27 BuildRequires: tomcat >= 8.0.49 %else %if 0%{?fedora} && 0%{?fedora} <= 28 BuildRequires: tomcat >= 1:8.5.23 %else %if 0%{?rhel} BuildRequires: pki-servlet-engine >= 1:9.0.7 %else BuildRequires: tomcat >= 1:9.0.7 %endif %endif %endif %endif ################################################################################ # Runtime Dependencies ################################################################################ # Java Requires: apache-commons-lang %if 0%{?fedora} >= 21 Requires: java-headless %else Requires: java %endif Requires: jpackage-utils >= 0:1.7.5-15 # SLF4J Requires: slf4j %if 0%{?rhel} # no slf4j-jdk14 %else Requires: slf4j-jdk14 %endif # JSS %if 0%{?rhel} && 0%{?rhel} <= 7 Requires: jss >= 4.4.0-7 %else Requires: jss >= 4.5.3 %endif # Tomcat %if 0%{?rhel} && 0%{?rhel} <= 7 Requires: tomcat >= 7.0.69 %else %if 0%{?fedora} && 0%{?fedora} <= 27 Requires: tomcat >= 8.0.49 %else %if 0%{?fedora} && 0%{?fedora} <= 28 Requires: tomcat >= 1:8.5.23 %else %if 0%{?rhel} Requires: pki-servlet-engine >= 1:9.0.7 %else Requires: tomcat >= 1:9.0.7 %endif %endif %endif %endif # The 'tomcatjss' package conflicts with the 'tomcat-native' package # because it uses an underlying NSS security model rather than the # OpenSSL security model, so these two packages may not co-exist. # (see Bugzilla Bug #441974 for details) Conflicts: tomcat-native # PKI Conflicts: pki-base < 10.6.5 %if 0%{?rhel} # For EPEL, override the '_sharedstatedir' macro on RHEL %define _sharedstatedir /var/lib %endif %description JSS Connector for Apache Tomcat, installed via the tomcatjss package, is a Java Secure Socket Extension (JSSE) module for Apache Tomcat that uses Java Security Services (JSS), a Java interface to Network Security Services (NSS). NOTE: The 'tomcatjss' package conflicts with the 'tomcat-native' package because it uses an underlying NSS security model rather than the OpenSSL security model, so these two packages may not co-exist. ################################################################################ %prep ################################################################################ %autosetup -n tomcatjss-%{version}%{?_phase} -p 1 -S git ################################################################################ %install ################################################################################ # get Tomcat . version number tomcat_version=`/usr/sbin/tomcat version | sed -n 's/Server number: *\([0-9]\+\.[0-9]\+\).*/\1/p'` if [ $tomcat_version == "9.0" ]; then app_server=tomcat-8.5 else app_server=tomcat-$tomcat_version fi ant -f build.xml \ -Dversion=%{version} \ -Dsrc.dir=$app_server \ -Djnidir=%{_jnidir} \ -Dinstall.doc.dir=%{buildroot}%{_docdir}/%{name} \ -Dinstall.jar.dir=%{buildroot}%{_javadir} \ install ################################################################################ %files ################################################################################ %defattr(-,root,root) %doc README %doc LICENSE %{_javadir}/* ################################################################################ %changelog * Thu Mar 15 2018 Dogtag PKI Team 7.3.0-0 - To list changes in since : $ git log --pretty=oneline --abbrev-commit --no-decorate ..