Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
16de44cc
Commit
16de44cc
authored
Oct 22, 2017
by
Daniel Salzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
knot/dnssec: code cleanup
parent
ee7db495
Pipeline
#21851
passed with stages
in 28 minutes and 47 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
21 additions
and
55 deletions
+21
-55
src/knot/dnssec/context.c
src/knot/dnssec/context.c
+1
-1
src/knot/dnssec/kasp/keystate.c
src/knot/dnssec/kasp/keystate.c
+1
-9
src/knot/dnssec/kasp/keystate.h
src/knot/dnssec/kasp/keystate.h
+2
-6
src/knot/dnssec/kasp/keystore.c
src/knot/dnssec/kasp/keystore.c
+8
-6
src/knot/dnssec/kasp/policy.h
src/knot/dnssec/kasp/policy.h
+0
-1
src/knot/dnssec/policy.c
src/knot/dnssec/policy.c
+2
-5
src/knot/dnssec/policy.h
src/knot/dnssec/policy.h
+1
-2
src/knot/dnssec/zone-events.c
src/knot/dnssec/zone-events.c
+0
-2
src/knot/dnssec/zone-keys.h
src/knot/dnssec/zone-keys.h
+4
-8
src/knot/dnssec/zone-sign.c
src/knot/dnssec/zone-sign.c
+2
-13
src/knot/dnssec/zone-sign.h
src/knot/dnssec/zone-sign.h
+0
-2
No files found.
src/knot/dnssec/context.c
View file @
16de44cc
...
...
@@ -16,8 +16,8 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "contrib/time.h"
#include "libknot/libknot.h"
#include "knot/dnssec/context.h"
#include "knot/dnssec/kasp/keystore.h"
...
...
src/knot/dnssec/kasp/keystate.c
View file @
16de44cc
...
...
@@ -14,22 +14,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <time.h>
#include <string.h>
#include "knot/dnssec/kasp/policy.h"
#include "knot/dnssec/kasp/keystate.h"
key_state_t
get_key_state
(
const
knot_kasp_key_t
*
key
,
knot_time_t
moment
)
{
if
(
!
key
||
moment
<=
0
)
{
if
(
!
key
||
moment
<=
0
)
{
return
DNSSEC_KEY_STATE_INVALID
;
}
const
knot_kasp_key_timing_t
*
t
=
&
key
->
timing
;
bool
removed
=
(
knot_time_cmp
(
t
->
remove
,
moment
)
<=
0
);
...
...
src/knot/dnssec/kasp/keystate.h
View file @
16de44cc
...
...
@@ -16,12 +16,10 @@
#pragma once
#include <time.h>
#include "contrib/time.h"
#include "knot/dnssec/kasp/policy.h"
enum
key_state
{
typedef
enum
{
DNSSEC_KEY_STATE_INVALID
=
0
,
DNSSEC_KEY_STATE_PRE_ACTIVE
,
DNSSEC_KEY_STATE_PUBLISHED
,
...
...
@@ -31,8 +29,6 @@ enum key_state {
DNSSEC_KEY_STATE_RETIRED
,
DNSSEC_KEY_STATE_POST_ACTIVE
,
DNSSEC_KEY_STATE_REMOVED
,
};
typedef
enum
key_state
key_state_t
;
}
key_state_t
;
key_state_t
get_key_state
(
const
knot_kasp_key_t
*
key
,
knot_time_t
moment
);
src/knot/dnssec/kasp/keystore.c
View file @
16de44cc
...
...
@@ -16,12 +16,14 @@
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "
knot/conf/schema
.h"
#include "
dnssec/error
.h"
#include "knot/dnssec/kasp/keystore.h"
#include "knot/conf/schema.h"
#include "libknot/error.h"
char
*
fix_path
(
const
char
*
config
,
const
char
*
base_path
)
static
char
*
fix_path
(
const
char
*
config
,
const
char
*
base_path
)
{
assert
(
config
);
assert
(
base_path
);
...
...
@@ -42,7 +44,7 @@ char *fix_path(const char *config, const char *base_path)
int
keystore_load
(
const
char
*
config
,
unsigned
backend
,
const
char
*
kasp_base_path
,
dnssec_keystore_t
**
keystore
)
{
int
ret
=
KNOT
_EINVAL
;
int
ret
=
DNSSEC
_EINVAL
;
char
*
fixed_config
=
NULL
;
switch
(
backend
)
{
...
...
@@ -57,7 +59,7 @@ int keystore_load(const char *config, unsigned backend,
default:
assert
(
0
);
}
if
(
ret
!=
KNOT
_EOK
)
{
if
(
ret
!=
DNSSEC
_EOK
)
{
free
(
fixed_config
);
return
knot_error_from_libdnssec
(
ret
);
}
...
...
@@ -68,7 +70,7 @@ int keystore_load(const char *config, unsigned backend,
}
ret
=
dnssec_keystore_init
(
*
keystore
,
fixed_config
);
if
(
ret
!=
KNOT
_EOK
)
{
if
(
ret
!=
DNSSEC
_EOK
)
{
free
(
fixed_config
);
dnssec_keystore_deinit
(
*
keystore
);
*
keystore
=
NULL
;
...
...
@@ -77,7 +79,7 @@ int keystore_load(const char *config, unsigned backend,
ret
=
dnssec_keystore_open
(
*
keystore
,
fixed_config
);
free
(
fixed_config
);
if
(
ret
!=
KNOT
_EOK
)
{
if
(
ret
!=
DNSSEC
_EOK
)
{
dnssec_keystore_deinit
(
*
keystore
);
*
keystore
=
NULL
;
return
knot_error_from_libdnssec
(
ret
);
...
...
src/knot/dnssec/kasp/policy.h
View file @
16de44cc
...
...
@@ -17,7 +17,6 @@
#pragma once
#include <stdbool.h>
#include <time.h>
#include "contrib/time.h"
#include "dnssec/lib/dnssec/key.h"
...
...
src/knot/dnssec/policy.c
View file @
16de44cc
/* Copyright (C) 201
6
CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 201
7
CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -16,10 +16,7 @@
#include <assert.h>
#include "knot/conf/conf.h"
#include "knot/dnssec/context.h"
#include "knot/dnssec/zone-nsec.h"
#include "knot/zone/contents.h"
#include "knot/dnssec/policy.h"
#include "libknot/rrtype/soa.h"
static
uint32_t
zone_soa_min_ttl
(
const
zone_contents_t
*
zone
)
...
...
src/knot/dnssec/policy.h
View file @
16de44cc
/* Copyright (C) 201
6
CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 201
7
CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -16,7 +16,6 @@
#pragma once
#include "contrib/time.h"
#include "knot/dnssec/context.h"
#include "knot/zone/contents.h"
...
...
src/knot/dnssec/zone-events.c
View file @
16de44cc
...
...
@@ -18,11 +18,9 @@
#include "dnssec/error.h"
#include "dnssec/random.h"
#include "contrib/macros.h"
#include "libknot/libknot.h"
#include "knot/conf/conf.h"
#include "knot/common/log.h"
#include "knot/dnssec/context.h"
#include "knot/dnssec/key-events.h"
#include "knot/dnssec/policy.h"
#include "knot/dnssec/zone-events.h"
...
...
src/knot/dnssec/zone-keys.h
View file @
16de44cc
...
...
@@ -26,7 +26,7 @@
/*!
* \brief Zone key context used during signing.
*/
struct
zone_key
{
typedef
struct
{
const
char
*
id
;
dnssec_key_t
*
key
;
dnssec_sign_ctx_t
*
ctx
;
...
...
@@ -40,18 +40,14 @@ struct zone_key {
bool
is_active
;
bool
is_public
;
int
cds_priority
;
};
typedef
struct
zone_key
zone_key_t
;
}
zone_key_t
;
dynarray_declare
(
keyptr
,
zone_key_t
*
,
DYNARRAY_VISIBILITY_PUBLIC
,
1
)
struct
zone_keyse
t
{
typedef
struc
t
{
size_t
count
;
zone_key_t
*
keys
;
};
typedef
struct
zone_keyset
zone_keyset_t
;
}
zone_keyset_t
;
/*!
* \brief Flags determining key type
...
...
src/knot/dnssec/zone-sign.c
View file @
16de44cc
...
...
@@ -15,37 +15,26 @@
*/
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <time.h>
#include "dnssec/error.h"
#include "dnssec/key.h"
#include "dnssec/keytag.h"
#include "dnssec/sign.h"
#include "knot/dnssec/context.h"
#include "knot/dnssec/key-events.h"
#include "knot/dnssec/rrset-sign.h"
#include "knot/dnssec/zone-keys.h"
#include "knot/dnssec/zone-sign.h"
#include "knot/updates/changesets.h"
#include "libknot/descriptor.h"
#include "libknot/dname.h"
#include "libknot/libknot.h"
#include "libknot/rrset.h"
#include "libknot/rrtype/rrsig.h"
#include "libknot/rrtype/soa.h"
#include "contrib/dynarray.h"
#include "contrib/macros.h"
#include "contrib/wire_ctx.h"
typedef
struct
type_node
{
typedef
struct
{
node_t
n
;
uint16_t
type
;
}
type_node_t
;
typedef
struct
signed_info
{
typedef
struct
{
knot_dname_t
*
dname
;
knot_dname_t
*
hashed_dname
;
list_t
*
type_list
;
...
...
src/knot/dnssec/zone-sign.h
View file @
16de44cc
...
...
@@ -18,10 +18,8 @@
#include "knot/updates/changesets.h"
#include "knot/updates/zone-update.h"
#include "knot/zone/zone.h"
#include "knot/zone/contents.h"
#include "knot/dnssec/context.h"
#include "knot/dnssec/zone-events.h"
#include "knot/dnssec/zone-keys.h"
/*!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment