From owner-svn-src-all@FreeBSD.ORG Fri Apr 3 10:21:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8D2B896; Fri, 3 Apr 2015 10:21:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AE09209; Fri, 3 Apr 2015 10:21:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t33AL0iw069768; Fri, 3 Apr 2015 10:21:00 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t33AL00o069766; Fri, 3 Apr 2015 10:21:00 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201504031021.t33AL00o069766@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 3 Apr 2015 10:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281016 - head/contrib/ntp/ntpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2015 10:21:00 -0000 Author: cy Date: Fri Apr 3 10:20:59 2015 New Revision: 281016 URL: https://svnweb.freebsd.org/changeset/base/281016 Log: Fix merge error. Submitted by: jkim Modified: head/contrib/ntp/ntpd/ntp_crypto.c Modified: head/contrib/ntp/ntpd/ntp_crypto.c ============================================================================== --- head/contrib/ntp/ntpd/ntp_crypto.c Fri Apr 3 10:17:36 2015 (r281015) +++ head/contrib/ntp/ntpd/ntp_crypto.c Fri Apr 3 10:20:59 2015 (r281016) @@ -826,10 +826,10 @@ crypto_recv( * Decrypt the cookie, hunting all the time for * errors. */ - if (vallen == (u_int) EVP_PKEY_size(host_pkey)) { + if (vallen == (u_int)EVP_PKEY_size(host_pkey)) { u_int32 *cookiebuf = malloc( RSA_size(host_pkey->pkey.rsa)); - if (cookiebuf == NULL) { + if (!cookiebuf) { rval = XEVNT_CKY; break; } @@ -3817,7 +3817,7 @@ crypto_setup(void) randfile); exit (-1); } - get_systime(&seed); + arc4random_buf(&seed, sizeof(l_fp)); RAND_seed(&seed, sizeof(l_fp)); RAND_write_file(randfile); #ifdef DEBUG @@ -3850,36 +3850,6 @@ crypto_setup(void) pinfo = crypto_key(filename, passwd, NULL); if (pinfo == NULL) { msyslog(LOG_ERR, - "crypto_setup: random seed file not specified"); - exit (-1); - } - if ((bytes = RAND_load_file(rand_file, -1)) == 0) { - msyslog(LOG_ERR, - "crypto_setup: random seed file %s not found\n", - rand_file); - exit (-1); - } - arc4random_buf(&seed, sizeof(l_fp)); - RAND_seed(&seed, sizeof(l_fp)); - RAND_write_file(rand_file); - OpenSSL_add_all_algorithms(); -#ifdef DEBUG - if (debug) - printf( - "crypto_setup: OpenSSL version %lx random seed file %s bytes read %d\n", - SSLeay(), rand_file, bytes); -#endif - - /* - * Load required host key from file "ntpkey_host_". If - * no host key file is not found or has invalid password, life - * as we know it ends. The host key also becomes the default - * sign key. - */ - snprintf(filename, sizeof(filename), "ntpkey_host_%s", hostname); - pinfo = crypto_key(filename, passwd, NULL); - if (pinfo == NULL) { - msyslog(LOG_ERR, "crypto_setup: host key file %s not found or corrupt", filename); exit (-1);