]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
Replace DNSSEC_SIGN_ERROR with KNOT_ECRYPTO
authorDaniel Salzman <daniel.salzman@nic.cz>
Wed, 22 Oct 2025 05:52:35 +0000 (07:52 +0200)
committerLibor Peltan <libor.peltan@nic.cz>
Fri, 24 Oct 2025 07:17:08 +0000 (09:17 +0200)
src/libknot/dnssec/error.c
src/libknot/dnssec/error.h
src/libknot/dnssec/sign/sign.c
src/libknot/dnssec/tsig.c
src/libknot/errcode.h
src/libknot/error.c

index 3d2a7b57c9411ab09cfd5d06903861b4dff3aefe..8de47d8a55aba9463155ed211a3d0a4642610845 100644 (file)
@@ -42,7 +42,7 @@ static const error_message_t ERROR_MESSAGES[] = {
        { KNOT_EEXIST,  "key already present" },
 
        { KNOT_ECRYPTO, "signing initialization error" },
-       { DNSSEC_SIGN_ERROR,            "signing error" },
+       { KNOT_ECRYPTO,         "signing error" },
        { DNSSEC_INVALID_SIGNATURE,     "invalid signature" },
 
        { DNSSEC_INVALID_NSEC3_ALGORITHM, "invalid NSEC3 algorithm" },
index 2540f4e1c35f20fa1a8b363cfd0e0590d6a8a8c9..b47b40564dcbd89c69f6a220c1a35f3c3592935a 100644 (file)
@@ -54,7 +54,7 @@ enum dnssec_error {
        KNOT_EEXIST,
 
        KNOT_ECRYPTO,
-       DNSSEC_SIGN_ERROR,
+       KNOT_ECRYPTO,
        DNSSEC_INVALID_SIGNATURE,
 
        KNOT_EALGORITHM,
index ed0a36ccecb1548a65785f669f0a4d1b1075ed26..aca96c552442713505fd5fa6018097d749bb8341 100644 (file)
@@ -292,7 +292,7 @@ int dnssec_sign_add(dnssec_sign_ctx_t *ctx, const dnssec_binary_t *data)
 
        void *result = vpool_insert(&ctx->buffer, vpool_get_length(&ctx->buffer), data->data, data->size);
        if (result == NULL) {
-               return DNSSEC_SIGN_ERROR;
+               return KNOT_ECRYPTO;
        }
 
        return KNOT_EOK;
@@ -325,7 +325,7 @@ int dnssec_sign_write(dnssec_sign_ctx_t *ctx, dnssec_sign_flags_t flags, dnssec_
                                               ctx->sign_algorithm,
                                               gnutls_flags, &data, &raw);
        if (result < 0) {
-               return DNSSEC_SIGN_ERROR;
+               return KNOT_ECRYPTO;
        }
 
        dnssec_binary_t bin_raw = binary_from_datum(&raw);
index b86fd370168ad97dd39f48570045d9243982e455..f5810ab999eeecf69c4e9aecc5524f381b29fbe6 100644 (file)
@@ -195,7 +195,7 @@ int dnssec_tsig_add(dnssec_tsig_ctx_t *ctx, const dnssec_binary_t *data)
 
        int result = gnutls_hmac(ctx->hash, data->data, data->size);
        if (result != 0) {
-               return DNSSEC_SIGN_ERROR;
+               return KNOT_ECRYPTO;
        }
 
        return KNOT_EOK;
index ed8d0d4da8772a795333ec08d1588bc71c752106..30496d4f1ad89e20e026de3e21f98d777914198e 100644 (file)
@@ -179,6 +179,7 @@ enum knot_error {
        KNOT_KEY_EEXPORT,
        KNOT_KEY_EGENERATE,
        KNOT_EALGORITHM,
+       KNOT_ECRYPTO,
 
        KNOT_ERROR_MAX = -501
 };
index 5d1285f773d4e0a164b9f1ecec22d2a58ba26ada..d1b17cb4a034cfd310a4885b09eb18b567c9c6c9 100644 (file)
@@ -178,6 +178,7 @@ static const struct error errors[] = {
        { KNOT_KEY_EEXPORT,            "failed to export key" },
        { KNOT_KEY_EGENERATE,          "failed to generate key" },
        { KNOT_EALGORITHM,             "invalid hash algorithm" },
+       { KNOT_ECRYPTO,                "crypto operation failed" },
 
        /* Terminator */
        { KNOT_ERROR, NULL }