Skip to content

Commit

Permalink
Add p12tool
Browse files Browse the repository at this point in the history
The p12tool command has been moved from pki-tools to jss-tools.
  • Loading branch information
edewata committed Mar 20, 2024
1 parent 890916c commit dfd7066
Show file tree
Hide file tree
Showing 23 changed files with 10,749 additions and 12 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,21 @@ jobs:
- name: Install build dependencies
run: |
apt-get update
# https://salsa.debian.org/freeipa-team/jss/-/blob/master/debian/control
apt-get install -y \
cmake zip unzip \
g++ libnss3-dev libnss3-tools \
openjdk-17-jdk libcommons-lang3-java libslf4j-java \
junit5 libopentest4j-java maven
cmake \
g++ \
junit5 \
libcommons-lang3-java \
libnss3-dev \
libnss3-tools \
libopentest4j-java \
libslf4j-java \
maven \
openjdk-17-jdk \
unzip \
zip
- name: Build JSS with CMake
run: ./build.sh
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ if(WITH_TESTS)
endif(WITH_TESTS)

add_subdirectory(symkey)
add_subdirectory(tools)

if(WITH_TESTS)
add_subdirectory(tests)
Expand All @@ -106,9 +105,11 @@ endif(WITH_TESTS)

add_custom_target(
native ALL
DEPENDS generate_c generate_so symkey_library sslget
DEPENDS generate_c generate_so symkey_library
)

add_subdirectory(tools)

if(WITH_TESTS)
add_dependencies(native generate_test_so)
endif(WITH_TESTS)
Expand Down
17 changes: 13 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,20 @@ jobs:
steps:
- script: |
docker exec -u 0 runner apt-get update
# https://salsa.debian.org/freeipa-team/jss/-/blob/master/debian/control
docker exec -u 0 runner apt-get install -y \
cmake zip unzip \
g++ libnss3-dev libnss3-tools \
openjdk-17-jdk libcommons-lang3-java libslf4j-java \
junit5 libopentest4j-java
cmake \
g++ \
junit5 \
libcommons-lang3-java \
libnss3-dev \
libnss3-tools \
libopentest4j-java \
libslf4j-java \
openjdk-17-jdk \
unzip \
zip
displayName: Install build dependencies
- script: ./build.sh
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ if [ "$BUILD_TARGET" = "dist" ] ; then
echo "- native binaries:"
echo " $WORK_DIR/libjss.so"
echo " $WORK_DIR/symkey/libjss-symkey.so"
echo " $WORK_DIR/tools/src/main/native/p12tool/p12tool"
echo " $WORK_DIR/tools/src/main/native/sslget/sslget"
fi

Expand Down
1 change: 1 addition & 0 deletions docs/changes/v5.6.0/Packaging-Changes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

A new `jss-tools` RPM package has been added to provide tools such as:

* `p12tool`
* `sslget`
3 changes: 2 additions & 1 deletion jss.spec
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Provides: jss-tools = %{version}-%{release}
Provides: jss-tools = %{major_version}.%{minor_version}
Provides: %{product_id}-tools = %{major_version}.%{minor_version}

# The sslget command has been moved from pki-tools into jss-tools.
# Some PKI tools have been moved into jss-tools.
Conflicts: pki-tools < 11.6
Conflicts: dogtag-pki-tools < 11.6

Expand Down Expand Up @@ -369,6 +369,7 @@ cp base/target/jss-tests.jar %{buildroot}%{_datadir}/jss/tests/lib
%files -n %{product_id}-tools
################################################################################

%{_bindir}/p12tool
%{_bindir}/sslget

%if %{with javadoc}
Expand Down
1 change: 1 addition & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project(tools)

if(WITH_NATIVE)
add_subdirectory(src/main/native/p12tool)
add_subdirectory(src/main/native/sslget)
endif(WITH_NATIVE)
29 changes: 29 additions & 0 deletions tools/src/main/native/p12tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
project(p12tool)

set(P12TOOL_PRIVATE_INCLUDE_DIRS
${CMAKE_BINARY_DIR}
${NSPR_INCLUDE_DIRS}
${NSS_INCLUDE_DIRS}
)

set(p12tool_SRCS
basicutil.c
pppolicy.c
secutil.c
secpwd.c
moreoids.c
p12tool.c
)

include_directories(${P12TOOL_PRIVATE_INCLUDE_DIRS})

add_executable(p12tool ${p12tool_SRCS})
add_dependencies(native p12tool)
target_link_libraries(p12tool smime3 ssl3 nss3 nssutil3 plc4 plds4 nspr4)

install(
TARGETS p12tool
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
Loading

0 comments on commit dfd7066

Please sign in to comment.