WIP: Cleanup the DST func API
This commit is contained in:
@@ -270,6 +270,7 @@ endif
|
||||
|
||||
libdns_la_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
-I/Users/ondrej/.local/usr/include/ \
|
||||
$(LIBDNS_CFLAGS) \
|
||||
$(LIBISC_CFLAGS) \
|
||||
$(LIBURCU_CFLAGS) \
|
||||
@@ -281,6 +282,7 @@ libdns_la_LDFLAGS = \
|
||||
-release "$(PACKAGE_VERSION)"
|
||||
|
||||
libdns_la_LIBADD = \
|
||||
/usr/local/lib/libsqisign_lvl1.a \
|
||||
$(LIBISC_LIBS) \
|
||||
$(LIBURCU_LIBS) \
|
||||
$(LIBUV_LIBS) \
|
||||
|
||||
+6
-7
@@ -265,8 +265,7 @@ dns_dnssec_sign(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
goto cleanup_databuf;
|
||||
}
|
||||
|
||||
ret = dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC, true, 0,
|
||||
&ctx);
|
||||
ret = dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC, true, &ctx);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
goto cleanup_databuf;
|
||||
}
|
||||
@@ -461,7 +460,7 @@ dns_dnssec_verify(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
|
||||
again:
|
||||
ret = dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC, false,
|
||||
maxbits, &ctx);
|
||||
&ctx);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
goto cleanup_struct;
|
||||
}
|
||||
@@ -554,7 +553,7 @@ again:
|
||||
|
||||
r.base = sig.signature;
|
||||
r.length = sig.siglen;
|
||||
ret = dst_context_verify2(ctx, maxbits, &r);
|
||||
ret = dst_context_verify(ctx, maxbits, &r);
|
||||
if (ret == ISC_R_SUCCESS && downcase) {
|
||||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
dns_name_format(&sig.signer, namebuf, sizeof(namebuf));
|
||||
@@ -811,7 +810,7 @@ dns_dnssec_signmessage(dns_message_t *msg, dst_key_t *key) {
|
||||
|
||||
isc_buffer_init(&databuf, data, sizeof(data));
|
||||
|
||||
RETERR(dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC, true, 0,
|
||||
RETERR(dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC, true,
|
||||
&ctx));
|
||||
|
||||
/*
|
||||
@@ -963,7 +962,7 @@ dns_dnssec_verifymessage(isc_buffer_t *source, dns_message_t *msg,
|
||||
goto failure;
|
||||
}
|
||||
|
||||
RETERR(dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC, false, 0,
|
||||
RETERR(dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC, false,
|
||||
&ctx));
|
||||
|
||||
/*
|
||||
@@ -1009,7 +1008,7 @@ dns_dnssec_verifymessage(isc_buffer_t *source, dns_message_t *msg,
|
||||
|
||||
sig_r.base = sig.signature;
|
||||
sig_r.length = sig.siglen;
|
||||
result = dst_context_verify(ctx, &sig_r);
|
||||
result = dst_context_verify(ctx, 0, &sig_r);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
msg->sig0status = dns_tsigerror_badsig;
|
||||
goto failure;
|
||||
|
||||
+6
-79
@@ -220,12 +220,6 @@ dst__lib_initialize(void) {
|
||||
|
||||
void
|
||||
dst__lib_shutdown(void) {
|
||||
for (size_t i = 0; i < DST_MAX_ALGS; i++) {
|
||||
if (dst_t_func[i] != NULL && dst_t_func[i]->cleanup != NULL) {
|
||||
dst_t_func[i]->cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
isc_mem_detach(&dst__mctx);
|
||||
}
|
||||
|
||||
@@ -246,7 +240,7 @@ dst_ds_digest_supported(unsigned int digest_type) {
|
||||
|
||||
isc_result_t
|
||||
dst_context_create(dst_key_t *key, isc_mem_t *mctx, isc_logcategory_t category,
|
||||
bool useforsigning, int maxbits, dst_context_t **dctxp) {
|
||||
bool useforsigning, dst_context_t **dctxp) {
|
||||
dst_context_t *dctx;
|
||||
isc_result_t result;
|
||||
|
||||
@@ -254,7 +248,7 @@ dst_context_create(dst_key_t *key, isc_mem_t *mctx, isc_logcategory_t category,
|
||||
REQUIRE(mctx != NULL);
|
||||
REQUIRE(dctxp != NULL && *dctxp == NULL);
|
||||
|
||||
if (key->func->createctx == NULL && key->func->createctx2 == NULL) {
|
||||
if (key->func->createctx == NULL) {
|
||||
return DST_R_UNSUPPORTEDALG;
|
||||
}
|
||||
if (key->keydata.generic == NULL) {
|
||||
@@ -269,11 +263,7 @@ dst_context_create(dst_key_t *key, isc_mem_t *mctx, isc_logcategory_t category,
|
||||
|
||||
dst_key_attach(key, &dctx->key);
|
||||
isc_mem_attach(mctx, &dctx->mctx);
|
||||
if (key->func->createctx2 != NULL) {
|
||||
result = key->func->createctx2(key, maxbits, dctx);
|
||||
} else {
|
||||
result = key->func->createctx(key, dctx);
|
||||
}
|
||||
result = key->func->createctx(key, dctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
if (dctx->key != NULL) {
|
||||
dst_key_free(&dctx->key);
|
||||
@@ -336,7 +326,7 @@ dst_context_sign(dst_context_t *dctx, isc_buffer_t *sig) {
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_context_verify(dst_context_t *dctx, isc_region_t *sig) {
|
||||
dst_context_verify(dst_context_t *dctx, int maxbits, isc_region_t *sig) {
|
||||
REQUIRE(VALID_CTX(dctx));
|
||||
REQUIRE(sig != NULL);
|
||||
|
||||
@@ -344,57 +334,12 @@ dst_context_verify(dst_context_t *dctx, isc_region_t *sig) {
|
||||
if (dctx->key->keydata.generic == NULL) {
|
||||
return DST_R_NULLKEY;
|
||||
}
|
||||
|
||||
if (dctx->key->func->verify == NULL) {
|
||||
return DST_R_NOTPUBLICKEY;
|
||||
}
|
||||
|
||||
return dctx->key->func->verify(dctx, sig);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_context_verify2(dst_context_t *dctx, unsigned int maxbits,
|
||||
isc_region_t *sig) {
|
||||
REQUIRE(VALID_CTX(dctx));
|
||||
REQUIRE(sig != NULL);
|
||||
|
||||
CHECKALG(dctx->key->key_alg);
|
||||
if (dctx->key->keydata.generic == NULL) {
|
||||
return DST_R_NULLKEY;
|
||||
}
|
||||
if (dctx->key->func->verify == NULL && dctx->key->func->verify2 == NULL)
|
||||
{
|
||||
return DST_R_NOTPUBLICKEY;
|
||||
}
|
||||
|
||||
return dctx->key->func->verify2 != NULL
|
||||
? dctx->key->func->verify2(dctx, maxbits, sig)
|
||||
: dctx->key->func->verify(dctx, sig);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dst_key_computesecret(const dst_key_t *pub, const dst_key_t *priv,
|
||||
isc_buffer_t *secret) {
|
||||
REQUIRE(VALID_KEY(pub) && VALID_KEY(priv));
|
||||
REQUIRE(secret != NULL);
|
||||
|
||||
CHECKALG(pub->key_alg);
|
||||
CHECKALG(priv->key_alg);
|
||||
|
||||
if (pub->keydata.generic == NULL || priv->keydata.generic == NULL) {
|
||||
return DST_R_NULLKEY;
|
||||
}
|
||||
|
||||
if (pub->key_alg != priv->key_alg || pub->func->computesecret == NULL ||
|
||||
priv->func->computesecret == NULL)
|
||||
{
|
||||
return DST_R_KEYCANNOTCOMPUTESECRET;
|
||||
}
|
||||
|
||||
if (!dst_key_isprivate(priv)) {
|
||||
return DST_R_NOTPRIVATEKEY;
|
||||
}
|
||||
|
||||
return pub->func->computesecret(pub, priv, secret);
|
||||
return dctx->key->func->verify(dctx, maxbits, sig);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
@@ -1320,24 +1265,6 @@ dst_key_pubcompare(const dst_key_t *key1, const dst_key_t *key2,
|
||||
return comparekeys(key1, key2, match_revoked_key, pub_compare);
|
||||
}
|
||||
|
||||
bool
|
||||
dst_key_paramcompare(const dst_key_t *key1, const dst_key_t *key2) {
|
||||
REQUIRE(VALID_KEY(key1));
|
||||
REQUIRE(VALID_KEY(key2));
|
||||
|
||||
if (key1 == key2) {
|
||||
return true;
|
||||
}
|
||||
if (key1->key_alg == key2->key_alg &&
|
||||
key1->func->paramcompare != NULL &&
|
||||
key1->func->paramcompare(key1, key2))
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
dst_key_attach(dst_key_t *source, dst_key_t **target) {
|
||||
REQUIRE(target != NULL && *target == NULL);
|
||||
|
||||
+2
-12
@@ -150,8 +150,6 @@ struct dst_func {
|
||||
* Context functions
|
||||
*/
|
||||
isc_result_t (*createctx)(dst_key_t *key, dst_context_t *dctx);
|
||||
isc_result_t (*createctx2)(dst_key_t *key, int maxbits,
|
||||
dst_context_t *dctx);
|
||||
void (*destroyctx)(dst_context_t *dctx);
|
||||
isc_result_t (*adddata)(dst_context_t *dctx, const isc_region_t *data);
|
||||
|
||||
@@ -159,14 +157,9 @@ struct dst_func {
|
||||
* Key operations
|
||||
*/
|
||||
isc_result_t (*sign)(dst_context_t *dctx, isc_buffer_t *sig);
|
||||
isc_result_t (*verify)(dst_context_t *dctx, const isc_region_t *sig);
|
||||
isc_result_t (*verify2)(dst_context_t *dctx, int maxbits,
|
||||
const isc_region_t *sig);
|
||||
isc_result_t (*computesecret)(const dst_key_t *pub,
|
||||
const dst_key_t *priv,
|
||||
isc_buffer_t *secret);
|
||||
isc_result_t (*verify)(dst_context_t *dctx, int maxbits,
|
||||
const isc_region_t *sig);
|
||||
bool (*compare)(const dst_key_t *key1, const dst_key_t *key2);
|
||||
bool (*paramcompare)(const dst_key_t *key1, const dst_key_t *key2);
|
||||
isc_result_t (*generate)(dst_key_t *key, int parms,
|
||||
void (*callback)(int));
|
||||
bool (*isprivate)(const dst_key_t *key);
|
||||
@@ -178,9 +171,6 @@ struct dst_func {
|
||||
isc_result_t (*tofile)(const dst_key_t *key, const char *directory);
|
||||
isc_result_t (*parse)(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub);
|
||||
|
||||
/* cleanup */
|
||||
void (*cleanup)(void);
|
||||
|
||||
isc_result_t (*fromlabel)(dst_key_t *key, const char *label,
|
||||
const char *pin);
|
||||
isc_result_t (*dump)(dst_key_t *key, isc_mem_t *mctx, char **buffer,
|
||||
|
||||
@@ -186,7 +186,8 @@ gssapi_sign(dst_context_t *dctx, isc_buffer_t *sig) {
|
||||
* Verify.
|
||||
*/
|
||||
static isc_result_t
|
||||
gssapi_verify(dst_context_t *dctx, const isc_region_t *sig) {
|
||||
gssapi_verify(dst_context_t *dctx, int maxbits ISC_ATTR_UNUSED,
|
||||
const isc_region_t *sig) {
|
||||
dst_gssapi_signverifyctx_t *ctx = dctx->ctxdata.gssctx;
|
||||
isc_region_t message;
|
||||
gss_buffer_desc gmessage, gsig;
|
||||
@@ -331,15 +332,11 @@ gssapi_dump(dst_key_t *key, isc_mem_t *mctx, char **buffer, int *length) {
|
||||
|
||||
static dst_func_t gssapi_functions = {
|
||||
gssapi_create_signverify_ctx,
|
||||
NULL, /*%< createctx2 */
|
||||
gssapi_destroy_signverify_ctx,
|
||||
gssapi_adddata,
|
||||
gssapi_sign,
|
||||
gssapi_verify,
|
||||
NULL, /*%< verify2 */
|
||||
NULL, /*%< computesecret */
|
||||
gssapi_compare,
|
||||
NULL, /*%< paramcompare */
|
||||
gssapi_generate,
|
||||
gssapi_isprivate,
|
||||
gssapi_destroy,
|
||||
@@ -347,7 +344,6 @@ static dst_func_t gssapi_functions = {
|
||||
NULL, /*%< fromdns */
|
||||
NULL, /*%< tofile */
|
||||
NULL, /*%< parse */
|
||||
NULL, /*%< cleanup */
|
||||
NULL, /*%< fromlabel */
|
||||
gssapi_dump,
|
||||
gssapi_restore,
|
||||
|
||||
+1
-5
@@ -69,6 +69,7 @@
|
||||
return (hmac_sign(dctx, sig)); \
|
||||
} \
|
||||
static isc_result_t hmac##alg##_verify(dst_context_t *dctx, \
|
||||
int maxbits ISC_ATTR_UNUSED, \
|
||||
const isc_region_t *sig) { \
|
||||
return (hmac_verify(dctx, sig)); \
|
||||
} \
|
||||
@@ -114,15 +115,11 @@
|
||||
} \
|
||||
static dst_func_t hmac##alg##_functions = { \
|
||||
hmac##alg##_createctx, \
|
||||
NULL, /*%< createctx2 */ \
|
||||
hmac##alg##_destroyctx, \
|
||||
hmac##alg##_adddata, \
|
||||
hmac##alg##_sign, \
|
||||
hmac##alg##_verify, \
|
||||
NULL, /*%< verify2 */ \
|
||||
NULL, /*%< computesecret */ \
|
||||
hmac##alg##_compare, \
|
||||
NULL, /*%< paramcompare */ \
|
||||
hmac##alg##_generate, \
|
||||
hmac##alg##_isprivate, \
|
||||
hmac##alg##_destroy, \
|
||||
@@ -130,7 +127,6 @@
|
||||
hmac##alg##_fromdns, \
|
||||
hmac##alg##_tofile, \
|
||||
hmac##alg##_parse, \
|
||||
NULL, /*%< cleanup */ \
|
||||
NULL, /*%< fromlabel */ \
|
||||
NULL, /*%< dump */ \
|
||||
NULL, /*%< restore */ \
|
||||
|
||||
@@ -218,7 +218,7 @@ dst_ds_digest_supported(unsigned int digest_type);
|
||||
|
||||
isc_result_t
|
||||
dst_context_create(dst_key_t *key, isc_mem_t *mctx, isc_logcategory_t category,
|
||||
bool useforsigning, int maxbits, dst_context_t **dctxp);
|
||||
bool useforsigning, dst_context_t **dctxp);
|
||||
/*%<
|
||||
* Creates a context to be used for a sign or verify operation.
|
||||
*
|
||||
@@ -284,11 +284,7 @@ dst_context_sign(dst_context_t *dctx, isc_buffer_t *sig);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dst_context_verify(dst_context_t *dctx, isc_region_t *sig);
|
||||
|
||||
isc_result_t
|
||||
dst_context_verify2(dst_context_t *dctx, unsigned int maxbits,
|
||||
isc_region_t *sig);
|
||||
dst_context_verify(dst_context_t *dctx, int maxbits, isc_region_t *sig);
|
||||
/*%<
|
||||
* Verifies the signature using the data and key stored in the context.
|
||||
*
|
||||
|
||||
@@ -838,7 +838,8 @@ err:
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
opensslecdsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
|
||||
opensslecdsa_verify(dst_context_t *dctx, int maxbits ISC_ATTR_UNUSED,
|
||||
const isc_region_t *sig) {
|
||||
isc_result_t ret;
|
||||
dst_key_t *key = dctx->key;
|
||||
int status;
|
||||
@@ -1173,15 +1174,11 @@ err:
|
||||
|
||||
static dst_func_t opensslecdsa_functions = {
|
||||
opensslecdsa_createctx,
|
||||
NULL, /*%< createctx2 */
|
||||
opensslecdsa_destroyctx,
|
||||
opensslecdsa_adddata,
|
||||
opensslecdsa_sign,
|
||||
opensslecdsa_verify,
|
||||
NULL, /*%< verify2 */
|
||||
NULL, /*%< computesecret */
|
||||
dst__openssl_keypair_compare,
|
||||
NULL, /*%< paramcompare */
|
||||
opensslecdsa_generate,
|
||||
dst__openssl_keypair_isprivate,
|
||||
dst__openssl_keypair_destroy,
|
||||
@@ -1189,7 +1186,6 @@ static dst_func_t opensslecdsa_functions = {
|
||||
opensslecdsa_fromdns,
|
||||
opensslecdsa_tofile,
|
||||
opensslecdsa_parse,
|
||||
NULL, /*%< cleanup */
|
||||
opensslecdsa_fromlabel, /*%< fromlabel */
|
||||
NULL, /*%< dump */
|
||||
NULL, /*%< restore */
|
||||
|
||||
@@ -211,7 +211,8 @@ err:
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
openssleddsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
|
||||
openssleddsa_verify(dst_context_t *dctx, int maxbits ISC_ATTR_UNUSED,
|
||||
const isc_region_t *sig) {
|
||||
isc_result_t ret;
|
||||
dst_key_t *key = dctx->key;
|
||||
int status;
|
||||
@@ -527,15 +528,11 @@ err:
|
||||
|
||||
static dst_func_t openssleddsa_functions = {
|
||||
openssleddsa_createctx,
|
||||
NULL, /*%< createctx2 */
|
||||
openssleddsa_destroyctx,
|
||||
openssleddsa_adddata,
|
||||
openssleddsa_sign,
|
||||
openssleddsa_verify,
|
||||
NULL, /*%< verify2 */
|
||||
NULL, /*%< computesecret */
|
||||
dst__openssl_keypair_compare,
|
||||
NULL, /*%< paramcompare */
|
||||
openssleddsa_generate,
|
||||
dst__openssl_keypair_isprivate,
|
||||
dst__openssl_keypair_destroy,
|
||||
@@ -543,7 +540,6 @@ static dst_func_t openssleddsa_functions = {
|
||||
openssleddsa_fromdns,
|
||||
openssleddsa_tofile,
|
||||
openssleddsa_parse,
|
||||
NULL, /*%< cleanup */
|
||||
openssleddsa_fromlabel,
|
||||
NULL, /*%< dump */
|
||||
NULL, /*%< restore */
|
||||
|
||||
@@ -310,7 +310,7 @@ opensslrsa_check_exponent_bits(EVP_PKEY *pkey, int maxbits) {
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
opensslrsa_verify2(dst_context_t *dctx, int maxbits, const isc_region_t *sig) {
|
||||
opensslrsa_verify(dst_context_t *dctx, int maxbits, const isc_region_t *sig) {
|
||||
dst_key_t *key = NULL;
|
||||
int status = 0;
|
||||
EVP_MD_CTX *evp_md_ctx = NULL;
|
||||
@@ -339,11 +339,6 @@ opensslrsa_verify2(dst_context_t *dctx, int maxbits, const isc_region_t *sig) {
|
||||
}
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
opensslrsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
|
||||
return opensslrsa_verify2(dctx, 0, sig);
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x30000000L
|
||||
static int
|
||||
progress_cb(int p, int n, BN_GENCB *cb) {
|
||||
@@ -1124,15 +1119,11 @@ err:
|
||||
|
||||
static dst_func_t opensslrsa_functions = {
|
||||
opensslrsa_createctx,
|
||||
NULL, /*%< createctx2 */
|
||||
opensslrsa_destroyctx,
|
||||
opensslrsa_adddata,
|
||||
opensslrsa_sign,
|
||||
opensslrsa_verify,
|
||||
opensslrsa_verify2,
|
||||
NULL, /*%< computesecret */
|
||||
dst__openssl_keypair_compare,
|
||||
NULL, /*%< paramcompare */
|
||||
opensslrsa_generate,
|
||||
dst__openssl_keypair_isprivate,
|
||||
dst__openssl_keypair_destroy,
|
||||
@@ -1140,7 +1131,6 @@ static dst_func_t opensslrsa_functions = {
|
||||
opensslrsa_fromdns,
|
||||
opensslrsa_tofile,
|
||||
opensslrsa_parse,
|
||||
NULL, /*%< cleanup */
|
||||
opensslrsa_fromlabel,
|
||||
NULL, /*%< dump */
|
||||
NULL, /*%< restore */
|
||||
|
||||
+6
-6
@@ -631,8 +631,8 @@ dns_tsig_sign(dns_message_t *msg) {
|
||||
* has validated at this point. This is why we include a
|
||||
* MAC length > 0 in the reply.
|
||||
*/
|
||||
result = dst_context_create(
|
||||
key->key, mctx, DNS_LOGCATEGORY_DNSSEC, true, 0, &ctx);
|
||||
result = dst_context_create(key->key, mctx,
|
||||
DNS_LOGCATEGORY_DNSSEC, true, &ctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
@@ -1005,7 +1005,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg,
|
||||
sig_r.length = tsig.siglen;
|
||||
|
||||
result = dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
false, 0, &ctx);
|
||||
false, &ctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
@@ -1117,7 +1117,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg,
|
||||
}
|
||||
}
|
||||
|
||||
result = dst_context_verify(ctx, &sig_r);
|
||||
result = dst_context_verify(ctx, 0, &sig_r);
|
||||
if (result == DST_R_VERIFYFAILURE) {
|
||||
result = DNS_R_TSIGVERIFYFAILURE;
|
||||
tsig_log(msg->tsigkey, 2,
|
||||
@@ -1308,7 +1308,7 @@ tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) {
|
||||
|
||||
if (msg->tsigctx == NULL) {
|
||||
result = dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
false, 0, &msg->tsigctx);
|
||||
false, &msg->tsigctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_querystruct;
|
||||
}
|
||||
@@ -1420,7 +1420,7 @@ tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) {
|
||||
goto cleanup_context;
|
||||
}
|
||||
|
||||
result = dst_context_verify(msg->tsigctx, &sig_r);
|
||||
result = dst_context_verify(msg->tsigctx, 0, &sig_r);
|
||||
if (result == DST_R_VERIFYFAILURE) {
|
||||
tsig_log(msg->tsigkey, 2,
|
||||
"signature failed to verify(2)");
|
||||
|
||||
@@ -188,12 +188,12 @@ check_sig(const char *datapath, const char *sigpath, const char *keyname,
|
||||
isc_buffer_remainingregion(&sigbuf, &sigreg);
|
||||
|
||||
result = dst_context_create(key, mctx, DNS_LOGCATEGORY_GENERAL, false,
|
||||
0, &ctx);
|
||||
&ctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dst_context_adddata(ctx, &datareg);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
result = dst_context_verify(ctx, &sigreg);
|
||||
result = dst_context_verify(ctx, 0, &sigreg);
|
||||
|
||||
/*
|
||||
* Compute the expected signature and emit it
|
||||
@@ -206,7 +206,7 @@ check_sig(const char *datapath, const char *sigpath, const char *keyname,
|
||||
|
||||
dst_context_destroy(&ctx);
|
||||
result2 = dst_context_create(key, mctx, DNS_LOGCATEGORY_GENERAL,
|
||||
false, 0, &ctx);
|
||||
false, &ctx);
|
||||
assert_int_equal(result2, ISC_R_SUCCESS);
|
||||
|
||||
result2 = dst_context_adddata(ctx, &datareg);
|
||||
|
||||
@@ -145,7 +145,7 @@ ISC_RUN_TEST_IMPL(isc_rsa_verify) {
|
||||
key->key_alg = DST_ALG_RSASHA1;
|
||||
|
||||
ret = dst_context_create(key, mctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
false, 0, &ctx);
|
||||
false, &ctx);
|
||||
assert_int_equal(ret, ISC_R_SUCCESS);
|
||||
|
||||
r.base = d;
|
||||
@@ -155,7 +155,7 @@ ISC_RUN_TEST_IMPL(isc_rsa_verify) {
|
||||
|
||||
r.base = sigsha1;
|
||||
r.length = 256;
|
||||
ret = dst_context_verify(ctx, &r);
|
||||
ret = dst_context_verify(ctx, 0, &r);
|
||||
assert_int_equal(ret, ISC_R_SUCCESS);
|
||||
|
||||
dst_context_destroy(&ctx);
|
||||
@@ -176,7 +176,7 @@ ISC_RUN_TEST_IMPL(isc_rsa_verify) {
|
||||
|
||||
r.base = sigsha256;
|
||||
r.length = 256;
|
||||
ret = dst_context_verify(ctx, &r);
|
||||
ret = dst_context_verify(ctx, 0, &r);
|
||||
assert_int_equal(ret, ISC_R_SUCCESS);
|
||||
|
||||
dst_context_destroy(&ctx);
|
||||
@@ -196,7 +196,7 @@ ISC_RUN_TEST_IMPL(isc_rsa_verify) {
|
||||
|
||||
r.base = sigsha512;
|
||||
r.length = 256;
|
||||
ret = dst_context_verify(ctx, &r);
|
||||
ret = dst_context_verify(ctx, 0, &r);
|
||||
assert_int_equal(ret, ISC_R_SUCCESS);
|
||||
|
||||
dst_context_destroy(&ctx);
|
||||
|
||||
@@ -324,7 +324,7 @@ tsig_tcp(isc_stdtime_t now, isc_result_t expected_result, bool mangle_sig) {
|
||||
dns_message_detach(&msg);
|
||||
|
||||
result = dst_context_create(key->key, mctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
false, 0, &outctx);
|
||||
false, &outctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_non_null(outctx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user