Ejemplo n.º 1
0
/* prints the bignum on stderr */
void ssh_print_bignum(const char *which, bignum num) {
#ifdef HAVE_LIBGCRYPT
  unsigned char *hex = NULL;
  bignum_bn2hex(num, &hex);
#elif defined HAVE_LIBCRYPTO
  char *hex = NULL;
  hex = bignum_bn2hex(num);
#endif
  fprintf(stderr, "%s value: ", which);
  fprintf(stderr, "%s\n", (hex == NULL) ? "(null)" : (char *) hex);
  SAFE_FREE(hex);
}
Ejemplo n.º 2
0
/* prints the bignum on stderr */
void ssh_print_bignum(const char *name, const bignum num)
{
    unsigned char *hex = NULL;
    if (num != NULL) {
        bignum_bn2hex(num, &hex);
    }
    fprintf(stderr, "%s value: %s\n", name, (hex == NULL) ? "(null)" : (char *) hex);
#ifdef HAVE_LIBGCRYPT
    SAFE_FREE(hex);
#elif defined HAVE_LIBCRYPTO
    OPENSSL_free(hex);
#elif defined HAVE_LIBMBEDCRYPTO
    SAFE_FREE(hex);
#endif
}