Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/dist/bind Pull up revisions 1.3-1.5 (requested by itojun):



details:   https://anonhg.NetBSD.org/src/rev/92001cc122a2
branches:  netbsd-1-5
changeset: 493177:92001cc122a2
user:      he <he%NetBSD.org@localhost>
date:      Mon Jul 01 17:13:57 2002 +0000

description:
Pull up revisions 1.3-1.5 (requested by itojun):
  Update BIND to version 8.3.3.

diffstat:

 dist/bind/bin/dnskeygen/dnskeygen.c |  20 ++++++++------
 dist/bind/lib/dst/bsafe_link.c      |  50 +++++++++++++++++-------------------
 dist/bind/man/named-xfer.8          |  12 +++-----
 3 files changed, 39 insertions(+), 43 deletions(-)

diffs (248 lines):

diff -r 5b61d4df86ba -r 92001cc122a2 dist/bind/bin/dnskeygen/dnskeygen.c
--- a/dist/bind/bin/dnskeygen/dnskeygen.c       Mon Jul 01 17:13:43 2002 +0000
+++ b/dist/bind/bin/dnskeygen/dnskeygen.c       Mon Jul 01 17:13:57 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: dnskeygen.c,v 1.1.1.1.8.1 2001/01/28 15:52:16 he Exp $ */
+/*     $NetBSD: dnskeygen.c,v 1.1.1.1.8.2 2002/07/01 17:13:57 he Exp $ */
 
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "Id: dnskeygen.c,v 1.11 2000/12/23 08:14:31 vixie Exp";
+static const char rcsid[] = "Id: dnskeygen.c,v 1.14 2001/09/25 04:50:14 marka Exp";
 #endif /* not lint */
 
 /*
@@ -35,8 +35,11 @@
 #include "port_after.h"
 
 #define PRINT_SUPPORTED 2
+#ifndef PATH_SEP
+#define PATH_SEP '/'
+#endif
 
-static void usage(char *str, int full);
+static void usage(const char *str, int full);
 
 static short dsa_sizes[] = {512, 576, 640, 704, 768, 832, 896, 960, 1024, 0};
 static char *prog;
@@ -56,7 +59,7 @@
        extern char *optarg;
 
        dst_init();
-       if ((prog = strrchr(argv[0],'/')) == NULL)
+       if ((prog = strrchr(argv[0], PATH_SEP)) == NULL)
                prog = strdup(argv[0]);
        else
                prog = strdup(++prog);
@@ -273,9 +276,10 @@
 }
 
 static void
-usage(char *str, int flag){
+usage(const char *str, int flag) {
        int i;
-       printf ("\nNo key generated\n");
+
+       printf("\nNo key generated\n");
        if (*str != '\0')
                printf("Usage:%s: %s\n",prog, str);
        printf("Usage:%s -{DHR} <size> [-F] -{zhu} [-ac]  [-p <no>]"
@@ -315,7 +319,5 @@
                printf("\n");
        }
 
-       exit (-3);
+       exit (3);
 }
-
-
diff -r 5b61d4df86ba -r 92001cc122a2 dist/bind/lib/dst/bsafe_link.c
--- a/dist/bind/lib/dst/bsafe_link.c    Mon Jul 01 17:13:43 2002 +0000
+++ b/dist/bind/lib/dst/bsafe_link.c    Mon Jul 01 17:13:57 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: bsafe_link.c,v 1.1.1.1.8.1 2001/01/28 15:52:20 he Exp $        */
+/*     $NetBSD: bsafe_link.c,v 1.1.1.1.8.2 2002/07/01 17:13:58 he Exp $        */
 
 #if defined(BSAFE) || defined(DNSSAFE)
-static const char rcsid[] = "Header: /proj/cvs/isc/bind8/src/lib/dst/bsafe_link.c,v 1.11 1999/10/13 16:39:22 vixie Exp";
+static const char rcsid[] = "Header: /proj/cvs/isc/bind8/src/lib/dst/bsafe_link.c,v 1.15 2001/09/25 04:50:28 marka Exp";
 
 /*
  * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -120,7 +120,7 @@
  *        BSAFE/DNSSAFE related functions 
  */
 int
-dst_bsafe_init()
+dst_bsafe_init(void)
 {
        if (dst_t_func[KEY_RSA] != NULL)
                return (1);
@@ -329,7 +329,8 @@
                if (ret == 0 && 
                    (status = B_DecryptUpdate(rsaEncryptor, work_area,
                                              &u_bytes, 0,
-                                             (u_char *) signature, sig_len,
+                                             (const u_char *) signature,
+                                             sig_len,
                                              NULL_PTR, NULL_SURRENDER)))
                        ret = VERIFY_FINAL_FAILURE;
 
@@ -387,24 +388,28 @@
        public = (B_KEY_OBJ)((RSA_Key *) in_key->dk_KEY_struct)->rk_Public_Key;
 
        n = B_GetKeyInfo((POINTER *) &pub, public, KI_RSAPublic);
-
-       if (out_len < pub->exponent.len) /* not enough space */
+       if (n != 0)
                return (-1);
-       if (pub->exponent.len < 256)  /* key exponent is <= 2040 bits */
+
+       if (pub->exponent.len < 256) {  /* key exponent is <= 2040 bits */
+               if ((unsigned int)out_len < pub->exponent.len + 1)
+                       return (-1);
                *op++ = (u_int8_t) pub->exponent.len;
-       else {                       /*  key exponent is > 2040 bits */
+       } else {                       /*  key exponent is > 2040 bits */
                u_int16_t e = (u_int16_t) pub->exponent.len;
-               *op++ = 0;          /* 3 byte lenght field */
+               if ((unsigned int)out_len < pub->exponent.len + 3)
+                       return (-1);
+               *op++ = 0;          /* 3 byte length field */
                dst_s_put_int16(op, e);
                op += sizeof(e);
                n = 2;
        }
+       n++;
+       memcpy(op, pub->exponent.data, pub->exponent.len);
+       op += pub->exponent.len;
        n += pub->exponent.len;
-       memcpy(op, pub->exponent.data, n);
-       op += n;
-       n++;
 
-       if ((out_len - n) > pub->modulus.len) {
+       if ((unsigned int)(out_len - n) >= pub->modulus.len) {
                /*copy exponent */
                memcpy(op, pub->modulus.data, pub->modulus.len);
                n += pub->modulus.len;
@@ -491,8 +496,6 @@
 
        B_SetKeyInfo(r_key->rk_Public_Key, KI_RSAPublic, (POINTER) public);
 
-       s_key->dk_id = (u_int16_t)
-               dst_s_get_int16(&public->modulus.data[public->modulus.len - 3]);
        s_key->dk_key_size = dst_bsafe_key_size(r_key);
        SAFE_FREE(public->modulus.data);
        SAFE_FREE(public->exponent.data);
@@ -616,7 +619,6 @@
        int status;
        char s[RAW_KEY_SIZE];
        int len, s_len = sizeof(s);
-       int tag = -1;
        const char *p = buff;
        RSA_Key *b_key;
        A_RSA_KEY *public;
@@ -752,8 +754,6 @@
        if (status)
                return (-1);
 
-       tag = (int)(u_int16_t)
-               dst_s_get_int16(&public->modulus.data[public->modulus.len - 3]);
        d_key->dk_key_size = dst_bsafe_key_size(b_key);
 
        SAFE_FREE(private->modulus.data);
@@ -768,7 +768,7 @@
        SAFE_FREE(public->modulus.data);
        SAFE_FREE(public->exponent.data);
        SAFE_FREE(public);
-       return (tag);
+       return (0);
 }
 
 
@@ -927,10 +927,7 @@
        rsa->rk_Public_Key = public;
        key->dk_KEY_struct = (void *) rsa;
 
-       /* fill in the footprint on generate key */
        B_GetKeyInfo((POINTER *) &pk_access, public, KI_RSAPublic);
-       key->dk_id = (u_int16_t)
-               dst_s_get_int16(&pk_access->modulus.data[pk_access->modulus.len - 3]);
        return (1);
 }
 
@@ -1050,7 +1047,7 @@
 
        if (digest_obj == NULL || *digest_obj == NULL) {
                printf("NO digest obj\n");
-               exit(-33);
+               exit(33);
        }
 
        if ((mode & SIG_MODE_INIT) &&
@@ -1059,8 +1056,7 @@
                return (SIGN_INIT_FAILURE);
 
        if ((mode & SIG_MODE_UPDATE) && data && (len > 0) &&
-           (status = B_DigestUpdate(*digest_obj, (u_char *) data, len,
-                                    NULL_SURRENDER)))
+           (status = B_DigestUpdate(*digest_obj, data, len, NULL_SURRENDER)))
                return (SIGN_UPDATE_FAILURE);
 
        if (mode & SIG_MODE_FINAL) {
@@ -1089,13 +1085,13 @@
 }
 
 int
-T_memcmp(POINTER firstBlock, POINTER secondBlock, unsigned int len)
+T_memcmp(CPOINTER firstBlock, CPOINTER secondBlock, unsigned int len)
 {
        return (memcmp(firstBlock, secondBlock, len));
 }
 
 void
-T_memcpy(POINTER output, POINTER input, unsigned int len)
+T_memcpy(POINTER output, CPOINTER input, unsigned int len)
 {
        memcpy(output, input, len);
 }
diff -r 5b61d4df86ba -r 92001cc122a2 dist/bind/man/named-xfer.8
--- a/dist/bind/man/named-xfer.8        Mon Jul 01 17:13:43 2002 +0000
+++ b/dist/bind/man/named-xfer.8        Mon Jul 01 17:13:57 2002 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: named-xfer.8,v 1.2 2000/06/14 05:54:30 itojun Exp $
+.\"     $NetBSD: named-xfer.8,v 1.2.2.1 2002/07/01 17:13:58 he Exp $
 .\"
 .\" ++Copyright++ 1985
 .\" -
@@ -74,8 +74,8 @@
 .\"    from named.8    6.6 (Berkeley) 2/14/89
 .\"
 .Dd June 26, 1993
-.Dt NAMED-XFER 8 
-.Os BSD 4
+.Dt NAMED-XFER 8
+.Os
 .Sh NAME
 .Nm named-xfer 
 .Nd ancillary agent for inbound zone transfers
@@ -91,9 +91,7 @@
 .Op Fl p Ar port#
 .Op Fl S 
 .Ar nameserver 
-.Op Ar [ Sy axfr 
-| 
-.Op Sy ixfr ]
+.Op Sy axfr | ixfr
 .Sh DESCRIPTION
 .Ic Named-xfer
 is an ancillary program executed by
@@ -163,7 +161,7 @@
 Additional arguments are taken as name server addresses in so-called
 .Dq dotted-quad 
 syntax 
-.Em only; 
+.Em only ;
 no host name are allowed here.  At least one address must be specified.  
 Any additional addresses will be tried, in order, if the first one fails 
 to transfer to us successfully.



Home | Main Index | Thread Index | Old Index