From owner-svn-src-head@FreeBSD.ORG Wed Feb 25 20:47:26 2015 Return-Path: Delivered-To: svn-src-head@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 92B71747; Wed, 25 Feb 2015 20:47:26 +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 7DDB86BA; Wed, 25 Feb 2015 20:47:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1PKlQT0020743; Wed, 25 Feb 2015 20:47:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1PKlQdg020742; Wed, 25 Feb 2015 20:47:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201502252047.t1PKlQdg020742@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 25 Feb 2015 20:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279296 - head/usr.bin/enigma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2015 20:47:26 -0000 Author: delphij Date: Wed Feb 25 20:47:25 2015 New Revision: 279296 URL: https://svnweb.freebsd.org/changeset/base/279296 Log: Explicitly crypt_set_format("des") and bail out if we can't. This would prevent problem when we changed the default crypt(3) algorithm or removed it in the future. PR: bin/189958 MFC after: 1 month Modified: head/usr.bin/enigma/enigma.c Modified: head/usr.bin/enigma/enigma.c ============================================================================== --- head/usr.bin/enigma/enigma.c Wed Feb 25 18:50:24 2015 (r279295) +++ head/usr.bin/enigma/enigma.c Wed Feb 25 20:47:25 2015 (r279296) @@ -43,6 +43,11 @@ setup(char *pw) int32_t seed; char *cryptpw; + if (crypt_set_format("des") == 0) { + fprintf(stderr, "crypt_set_format(\"des\") failed.\n"); + exit(1); + } + strlcpy(salt, pw, sizeof(salt)); cryptpw = crypt(pw, salt); if (cryptpw == NULL) {