~kernevil/ubuntu/trusty/bind9/sdlz-hmac-keys

« back to all changes in this revision

Viewing changes to bin/dnssec/dnssec-keyfromlabel.c

  • Committer: Package Import Robot
  • Author(s): LaMont Jones, Matthew Grant, LaMont Jones
  • Date: 2012-10-29 08:37:49 UTC
  • mfrom: (1.9.2)
  • Revision ID: package-import@ubuntu.com-20121029083749-r9inpzl0yuj9xdlu
Tags: 1:9.8.4.dfsg-1
[Matthew Grant]

* Turn off dlopen as it was causing test compile failures.
* Add missing library .postrm files for debhelper

[LaMont Jones]

* New upstream version
* soname fixup
* Ack NMUs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2007-2011  Internet Systems Consortium, Inc. ("ISC")
 
2
 * Copyright (C) 2007-2012  Internet Systems Consortium, Inc. ("ISC")
3
3
 *
4
4
 * Permission to use, copy, modify, and/or distribute this software for any
5
5
 * purpose with or without fee is hereby granted, provided that the above
14
14
 * PERFORMANCE OF THIS SOFTWARE.
15
15
 */
16
16
 
17
 
/* $Id: dnssec-keyfromlabel.c,v 1.32.14.2 2011-03-12 04:59:14 tbox Exp $ */
 
17
/* $Id: dnssec-keyfromlabel.c,v 1.32.14.4 2011/11/30 00:51:38 marka Exp $ */
18
18
 
19
19
/*! \file */
20
20
 
55
55
 
56
56
static const char *algs = "RSA | RSAMD5 | DH | DSA | RSASHA1 |"
57
57
                          " NSEC3DSA | NSEC3RSASHA1 |"
58
 
                          " RSASHA256 | RSASHA512 | ECCGOST";
 
58
                          " RSASHA256 | RSASHA512 | ECCGOST |"
 
59
                          " ECDSAP256SHA256 | ECDSAP384SHA384";
59
60
 
60
61
ISC_PLATFORM_NORETURN_PRE static void
61
62
usage(void) ISC_PLATFORM_NORETURN_POST;
110
111
 
111
112
int
112
113
main(int argc, char **argv) {
113
 
        char            *algname = NULL, *nametype = NULL, *type = NULL;
 
114
        char            *algname = NULL, *freeit = NULL;
 
115
        char            *nametype = NULL, *type = NULL;
114
116
        const char      *directory = NULL;
115
117
#ifdef USE_PKCS11
116
118
        const char      *engine = "pkcs11";
342
344
                        algname = strdup(DEFAULT_NSEC3_ALGORITHM);
343
345
                else
344
346
                        algname = strdup(DEFAULT_ALGORITHM);
 
347
                if (algname == NULL)
 
348
                        fatal("strdup failed");
 
349
                freeit = algname;
345
350
                if (verbose > 0)
346
351
                        fprintf(stderr, "no algorithm specified; "
347
352
                                "defaulting to %s\n", algname);
365
370
        if (use_nsec3 &&
366
371
            alg != DST_ALG_NSEC3DSA && alg != DST_ALG_NSEC3RSASHA1 &&
367
372
            alg != DST_ALG_RSASHA256 && alg != DST_ALG_RSASHA512 &&
368
 
            alg != DST_ALG_ECCGOST) {
 
373
            alg != DST_ALG_ECCGOST &&
 
374
            alg != DST_ALG_ECDSA256 && alg != DST_ALG_ECDSA384) {
369
375
                fatal("%s is incompatible with NSEC3; "
370
376
                      "do not use the -3 option", algname);
371
377
        }
514
520
         * is a risk of ID collision due to this key or another key
515
521
         * being revoked.
516
522
         */
517
 
        if (key_collision(dst_key_id(key), name, directory, alg, mctx, &exact))
518
 
        {
 
523
        if (key_collision(key, name, directory, mctx, &exact)) {
519
524
                isc_buffer_clear(&buf);
520
525
                ret = dst_key_buildfilename(key, 0, directory, &buf);
521
526
                if (ret != ISC_R_SUCCESS)
560
565
        isc_mem_free(mctx, label);
561
566
        isc_mem_destroy(&mctx);
562
567
 
 
568
        if (freeit != NULL)
 
569
                free(freeit);
 
570
 
563
571
        return (0);
564
572
}