diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-26 10:09:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-26 10:09:03 +0000 |
commit | fd4db43fe74e67f83b7013c7b98f97bb14d9b028 (patch) | |
tree | 07edd9a9d303629c2acd6e9d09860d6716273f54 /src | |
parent | 732081dcd1eec1f10f7b9a0c8be2f10f73d84f68 (diff) | |
download | gnunet-fd4db43fe74e67f83b7013c7b98f97bb14d9b028.tar.gz gnunet-fd4db43fe74e67f83b7013c7b98f97bb14d9b028.zip |
sketch envisioned API
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_my_lib.h | 4 | ||||
-rw-r--r-- | src/my/my.c | 7 | ||||
-rw-r--r-- | src/util/crypto_rsa.c | 16 |
3 files changed, 19 insertions, 8 deletions
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); | |||
304 | * FIXME. | 304 | * FIXME. |
305 | * | 305 | * |
306 | */ | 306 | */ |
307 | 307 | ||
308 | /** | 308 | /** |
309 | * Variable-size result expected | 309 | * Variable-size result expected |
310 | * | 310 | * |
@@ -390,7 +390,7 @@ struct GNUNET_MY_ResultSpec | |||
390 | GNUNET_MY_result_spec_uint64 (uint64_t *u64); | 390 | GNUNET_MY_result_spec_uint64 (uint64_t *u64); |
391 | 391 | ||
392 | int | 392 | int |
393 | GNUNET_MY_extract_result (MYSQL_BIND * result, | 393 | GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, |
394 | struct GNUNET_MY_QueryParam *qp, | 394 | struct GNUNET_MY_QueryParam *qp, |
395 | struct GNUNET_MY_ResultSpec *specs, | 395 | struct GNUNET_MY_ResultSpec *specs, |
396 | int row); | 396 | 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, | |||
108 | #GNUNET_SYSERR if a result was invalid | 108 | #GNUNET_SYSERR if a result was invalid |
109 | */ | 109 | */ |
110 | int | 110 | int |
111 | GNUNET_MY_extract_result (MYSQL_BIND * result, | 111 | GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, |
112 | struct GNUNET_MY_QueryParam *qp, | 112 | struct GNUNET_MY_QueryParam *qp, |
113 | struct GNUNET_MY_ResultSpec *rs, | 113 | struct GNUNET_MY_ResultSpec *rs, |
114 | int row) | 114 | int row) |
115 | { | 115 | { |
116 | MYSQL_BIND * result; | ||
116 | unsigned int i; | 117 | unsigned int i; |
117 | int had_null = GNUNET_NO; | 118 | int had_null = GNUNET_NO; |
118 | int ret; | 119 | int ret; |
120 | MYSQL_STMT *stmt; | ||
119 | 121 | ||
122 | stmt = GNUNET_MYSQL_statement_get_stmt (NULL /* FIXME */, sh); | ||
123 | // result = mysql_get_result (stmt); | ||
124 | result = NULL; | ||
120 | for (i = 0 ; NULL != rs[i].conv ; i++) | 125 | for (i = 0 ; NULL != rs[i].conv ; i++) |
121 | { | 126 | { |
122 | struct GNUNET_MY_ResultSpec *spec; | 127 | 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, | |||
803 | struct GNUNET_CRYPTO_RsaPublicKey *public_key; | 803 | struct GNUNET_CRYPTO_RsaPublicKey *public_key; |
804 | gcry_sexp_t data; | 804 | gcry_sexp_t data; |
805 | gcry_sexp_t result; | 805 | gcry_sexp_t result; |
806 | int rc; | ||
806 | 807 | ||
807 | data = mpi_to_sexp (value); | 808 | data = mpi_to_sexp (value); |
808 | 809 | ||
809 | if (0 != | 810 | if (0 != |
810 | gcry_pk_sign (&result, | 811 | (rc = gcry_pk_sign (&result, |
811 | data, | 812 | data, |
812 | key->sexp)) | 813 | key->sexp))) |
813 | { | 814 | { |
815 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
816 | _("RSA signing failed at %s:%d: %s\n"), | ||
817 | __FILE__, | ||
818 | __LINE__, | ||
819 | gcry_strerror (rc)); | ||
814 | GNUNET_break (0); | 820 | GNUNET_break (0); |
815 | return NULL; | 821 | return NULL; |
816 | } | 822 | } |
@@ -863,7 +869,7 @@ GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | |||
863 | 869 | ||
864 | sig = rsa_sign_mpi (key, v); | 870 | sig = rsa_sign_mpi (key, v); |
865 | gcry_mpi_release (v); | 871 | gcry_mpi_release (v); |
866 | return sig; | 872 | return sig; |
867 | } | 873 | } |
868 | 874 | ||
869 | 875 | ||
@@ -890,7 +896,7 @@ GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | |||
890 | 896 | ||
891 | sig = rsa_sign_mpi (key, v); | 897 | sig = rsa_sign_mpi (key, v); |
892 | gcry_mpi_release (v); | 898 | gcry_mpi_release (v); |
893 | return sig; | 899 | return sig; |
894 | 900 | ||
895 | } | 901 | } |
896 | 902 | ||