From owner-svn-soc-all@freebsd.org Sat Jul 18 13:09:58 2015 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 639F99A335E for ; Sat, 18 Jul 2015 13:09:58 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (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 3A67A1509 for ; Sat, 18 Jul 2015 13:09:58 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id t6ID9wVX028504 for ; Sat, 18 Jul 2015 13:09:58 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id t6ID9vSJ028502 for svn-soc-all@FreeBSD.org; Sat, 18 Jul 2015 13:09:57 GMT (envelope-from def@FreeBSD.org) Date: Sat, 18 Jul 2015 13:09:57 GMT Message-Id: <201507181309.t6ID9vSJ028502@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r288528 - soc2013/def/crashdump-head/sbin/cryptcore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2015 13:09:58 -0000 Author: def Date: Sat Jul 18 13:09:57 2015 New Revision: 288528 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=288528 Log: Change data types of bytes and size variables to ssize_t. Modified: soc2013/def/crashdump-head/sbin/cryptcore/cryptcore.c Modified: soc2013/def/crashdump-head/sbin/cryptcore/cryptcore.c ============================================================================== --- soc2013/def/crashdump-head/sbin/cryptcore/cryptcore.c Sat Jul 18 12:25:47 2015 (r288527) +++ soc2013/def/crashdump-head/sbin/cryptcore/cryptcore.c Sat Jul 18 13:09:57 2015 (r288528) @@ -97,8 +97,9 @@ FILE *fp; struct kerneldumpkey *kdk; RSA *privkey; - int err, fd, ofd, privkeysize, size; - size_t bufused, bytes; + int err, fd, ofd, olen, privkeysize; + ssize_t bytes, size; + size_t bufused; PJDLOG_ASSERT(privkeyfile != NULL); PJDLOG_ASSERT(keyfile != NULL); @@ -120,8 +121,8 @@ fd = open(keyfile, O_RDONLY); if (fd == -1) pjdlog_exit(1, "Unable to open %s", keyfile); - size = (int)read(fd, kdk, sizeof(struct kerneldumpkey)); - if (size == sizeof(struct kerneldumpkey)) { + size = read(fd, kdk, sizeof(struct kerneldumpkey)); + if (size == (ssize_t)sizeof(struct kerneldumpkey)) { kdk = realloc(kdk, kdk->kdk_size); size += read(fd, &kdk->kdk_encryptedkey, kdk->kdk_size - sizeof(struct kerneldumpkey)); @@ -129,7 +130,7 @@ err = errno; close(fd); fd = -1; - if (size != (int)kdk->kdk_size) { + if (size != (ssize_t)kdk->kdk_size) { errno = err; pjdlog_exit(1, "Unable to read data from %s", keyfile); } @@ -178,14 +179,14 @@ if (bufused != sizeof(buf)) continue; - if (EVP_DecryptUpdate(&ctx, buf, &size, buf, + if (EVP_DecryptUpdate(&ctx, buf, &olen, buf, sizeof(buf)) == 0) { pjdlog_error("Unable to decrypt core."); goto failed; } - PJDLOG_ASSERT(size == sizeof(buf)); + PJDLOG_ASSERT(olen == (int)sizeof(buf)); - if (write(ofd, buf, sizeof(buf)) != sizeof(buf)) { + if (write(ofd, buf, sizeof(buf)) != (ssize_t)sizeof(buf)) { pjdlog_errno(LOG_ERR, "Unable to write data to %s", output); goto failed;