-1

The error message I am getting when running ntp-keygen (or ntpd) on my ARM device is:

./ntp-keygen: relocation error: ./ntp-keygen: symbol DSA_generate_parameters_ex, version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference

The script to configure, build and install OpenSSL is as follows:

#!/bin/bash

# Build dependencies if any.
depends()
{
   cd $buildDir
   if [ "x${PERL}" = "x" ]; then
      export PERL=`which perl`
   fi

   return $?
}

# Configure software package.
configure()
{
   depends
   cd $packageDir

   # Available ciphers:
   #    DES, AES, CAMELLIA, MD2, MDC2, MD4, MD5, HMAC, SHA, RIPEMD, WHIRLPOOL,
   #    RC4, RC5, RC2, IDEA, SEED, BF(blowfish), CAST, RSA, DSA, ECDSA, ECDH
   # We use:
   #    DES, AES, MD4, MD5, HMAC, SHA, RSA, ECDSA, ECDH
   ./Configure shared threads --prefix=$PWD/install-arm linux-armv4

   return $?
}


# Build the software package.
compile()
{ 
   local mmx_machine_type=`echo $MMX_MACHINE_TYPE | tr '[:upper:]' '[:lower:]'`

   depends
   cd $packageDir

   export CFLAGS="$CFLAGS -DCONFIG_MACHINE_${MMX_MACHINE_TYPE}"
   configure

   if [ "$?" -ne "0" ]; then return 1; fi

   make CC=$CC AR=$AR NM=$NM RANLIB=$RANLIB
   if [ "$?" -ne "0" ]; then return 1; fi

   make CC=$CC AR=$AR NM=$NM RANLIB=$RANLIB install
   if [ "$?" -ne "0" ]; then return 1; fi

   return 0
}


# Clean-up.
clean()
{
   depends
   cd $packageDir

   rm -rf install-arm/*
   rm -rf install-i386/*
   make clean
}


# Install to rootfs the necessary pieces (e.g. directories, links...)
install()
{
   targetPath=${buildDir}/.tmp.rootfs/rootfs
   
   local openssl="bin/openssl"
   local libssl="lib/libssl.so.1.1"
   local libcrypto="lib/libcrypto.so.1.1"

   cd ${packageDir}/install-arm

   if [ -f ${openssl} -a -f ${libssl} -a -f ${libcrypto} ]
   then
      cp ${openssl}   ${targetPath}/sbin/
      cp ${libssl}    ${targetPath}/lib/
      cp ${libcrypto} ${targetPath}/lib/
   else
      printf "  $package not built.\n"
   fi

   return 0
}

For the ntp package, the only reference to OpenSSL is in the configure options. Below is the full ntp package configurations:

#!/bin/sh

# Configure software package.
configure()
{
  cd $packageDir

  ./bootstrap
  ./configure --host=arm-linux --with-yielding-select=yes  --with-crypto=openssl \
    --with-openssl-incdir=$OPENSSL_DIR/install-arm/include/ \
        --with-openssl-libdir=$OPENSSL_DIR/install-arm/lib/ \

  return $?
}


# Build the software package.
compile()
{ 
  cd $packageDir

  # make PROJECT_NAME=$project
  make
  if [ "$?" -ne "0" ]; then return 1; fi

  return 0
}


# Clean-up.
clean()
{
  cd $packageDir
  make clean
}


# Install to rootfs the necessary pieces (e.g. directories, links...)
install()
{
  cd $packageDir

  sourcePath=.
  targetPath=$buildDir/.tmp.rootfs/rootfs

  if [[ -f $sourcePath/ntpclient ]]; then
     cp $sourcePath/$package $targetPath/sbin/
  else
     printf "  $package not built.\n"
     return 1
  fi

  return 0
}

1 Answer 1

-2

Based on the error message you're getting, it looks like the ntp-keygen command is trying to use a function named DSA_generate_parameters_ex from the OpenSSL library, but this function is not defined in the version of the library that you have installed. This could be because you are using an older version of OpenSSL that does not include this function, or because there is an issue with the way the library is being linked to ntp-keygen.

To fix this error, you could try updating to a newer version of OpenSSL that includes the DSA_generate_parameters_ex function, or you could try re-building the OpenSSL library and ntp-keygen to ensure that they are linked correctly. You can also try using the ldd command to check the dependencies of the ntp-keygen binary and make sure that it is linked to the correct version of the OpenSSL library.

3
  • Thank you that makes a lot of sense. Commented Dec 12, 2022 at 5:57
  • 1
    So how come @AwesomeJackify were able to build the application? It does not make sense that the library was of the wrong version while the header had the correct function prototype. Please explain this. Commented Dec 12, 2022 at 7:38
  • I'm not entirely sure but after upgrading to OpenSSL 3.0.7 (and moving libcrypto.so.3 to the ARM device's shared library folder), the package works on the ARM device ! Commented Dec 12, 2022 at 22:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.