From: Christian Grothoff Date: Thu, 26 May 2016 10:09:03 +0000 (+0000) Subject: sketch envisioned API X-Git-Tag: initial-import-from-subversion-38251~843 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fd4db43fe74e67f83b7013c7b98f97bb14d9b028;p=oweals%2Fgnunet.git sketch envisioned API --- diff --git a/src/include/gnunet_my_lib.h b/src/include/gnunet_my_lib.h index 6931ddcbd..c83fc99ae 100644 --- a/src/include/gnunet_my_lib.h +++ b/src/include/gnunet_my_lib.h @@ -304,7 +304,7 @@ GNUNET_MY_query_param_uint64 (const uint64_t *x); * FIXME. * */ - + /** * Variable-size result expected * @@ -390,7 +390,7 @@ struct GNUNET_MY_ResultSpec GNUNET_MY_result_spec_uint64 (uint64_t *u64); int -GNUNET_MY_extract_result (MYSQL_BIND * result, +GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, struct GNUNET_MY_QueryParam *qp, struct GNUNET_MY_ResultSpec *specs, int row); diff --git a/src/my/my.c b/src/my/my.c index 886f0c6f6..1ab4a64db 100644 --- a/src/my/my.c +++ b/src/my/my.c @@ -108,15 +108,20 @@ GNUNET_MY_exec_prepared (struct GNUNET_MYSQL_Context *mc, #GNUNET_SYSERR if a result was invalid */ int -GNUNET_MY_extract_result (MYSQL_BIND * result, +GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, struct GNUNET_MY_QueryParam *qp, struct GNUNET_MY_ResultSpec *rs, int row) { + MYSQL_BIND * result; unsigned int i; int had_null = GNUNET_NO; int ret; + MYSQL_STMT *stmt; + stmt = GNUNET_MYSQL_statement_get_stmt (NULL /* FIXME */, sh); + // result = mysql_get_result (stmt); + result = NULL; for (i = 0 ; NULL != rs[i].conv ; i++) { struct GNUNET_MY_ResultSpec *spec; diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index 581754bb4..ab3ce6fe7 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c @@ -803,14 +803,20 @@ rsa_sign_mpi (const struct GNUNET_CRYPTO_RsaPrivateKey *key, struct GNUNET_CRYPTO_RsaPublicKey *public_key; gcry_sexp_t data; gcry_sexp_t result; + int rc; data = mpi_to_sexp (value); if (0 != - gcry_pk_sign (&result, - data, - key->sexp)) + (rc = gcry_pk_sign (&result, + data, + key->sexp))) { + LOG (GNUNET_ERROR_TYPE_WARNING, + _("RSA signing failed at %s:%d: %s\n"), + __FILE__, + __LINE__, + gcry_strerror (rc)); GNUNET_break (0); return NULL; } @@ -863,7 +869,7 @@ GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, sig = rsa_sign_mpi (key, v); gcry_mpi_release (v); - return sig; + return sig; } @@ -890,7 +896,7 @@ GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key, sig = rsa_sign_mpi (key, v); gcry_mpi_release (v); - return sig; + return sig; }