]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: replace cast with call to sshbuf_mutable_ptr(); ok djm@
authormarkus@openbsd.org <markus@openbsd.org>
Mon, 9 Jul 2018 21:59:10 +0000 (21:59 +0000)
committerDamien Miller <djm@mindrot.org>
Tue, 10 Jul 2018 06:44:17 +0000 (16:44 +1000)
OpenBSD-Commit-ID: 4dfe9d29fa93d9231645c89084f7217304f7ba29

authfd.c
authfile.c
msg.c
ssh-keygen.c
ssh-pkcs11-client.c
sshkey-xmss.c

index f24230b7c2433fd99085bb0f467d77101657a150..ecdd869abf01b10b8f2fb0254d4aafb66420fe12 100644 (file)
--- a/authfd.c
+++ b/authfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfd.c,v 1.110 2018/07/03 11:39:54 djm Exp $ */
+/* $OpenBSD: authfd.c,v 1.111 2018/07/09 21:59:10 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -133,7 +133,7 @@ ssh_request_reply(int sock, struct sshbuf *request, struct sshbuf *reply)
 
        /* Send the length and then the packet to the agent. */
        if (atomicio(vwrite, sock, buf, 4) != 4 ||
-           atomicio(vwrite, sock, (u_char *)sshbuf_ptr(request),
+           atomicio(vwrite, sock, sshbuf_mutable_ptr(request),
            sshbuf_len(request)) != sshbuf_len(request))
                return SSH_ERR_AGENT_COMMUNICATION;
        /*
index c3a6345d34383305a5f445d1edb417701c5f787b..be4a57736acfef41fea4414eb6e13bac4f7688a7 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfile.c,v 1.129 2018/06/06 18:29:18 markus Exp $ */
+/* $OpenBSD: authfile.c,v 1.130 2018/07/09 21:59:10 markus Exp $ */
 /*
  * Copyright (c) 2000, 2013 Markus Friedl.  All rights reserved.
  *
@@ -59,7 +59,7 @@ sshkey_save_private_blob(struct sshbuf *keybuf, const char *filename)
 
        if ((fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0)
                return SSH_ERR_SYSTEM_ERROR;
-       if (atomicio(vwrite, fd, (u_char *)sshbuf_ptr(keybuf),
+       if (atomicio(vwrite, fd, sshbuf_mutable_ptr(keybuf),
            sshbuf_len(keybuf)) != sshbuf_len(keybuf)) {
                oerrno = errno;
                close(fd);
diff --git a/msg.c b/msg.c
index 5a7b8ca91291845d5910fa956c2829a03da510b7..1bd20f3d305bf2fe3526f4b648c00efa4a1091ef 100644 (file)
--- a/msg.c
+++ b/msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msg.c,v 1.16 2015/01/15 09:40:00 djm Exp $ */
+/* $OpenBSD: msg.c,v 1.17 2018/07/09 21:59:10 markus Exp $ */
 /*
  * Copyright (c) 2002 Markus Friedl.  All rights reserved.
  *
@@ -55,7 +55,7 @@ ssh_msg_send(int fd, u_char type, struct sshbuf *m)
                error("ssh_msg_send: write");
                return (-1);
        }
-       if (atomicio(vwrite, fd, (u_char *)sshbuf_ptr(m), mlen) != mlen) {
+       if (atomicio(vwrite, fd, sshbuf_mutable_ptr(m), mlen) != mlen) {
                error("ssh_msg_send: write");
                return (-1);
        }
index ccebbaf76ba873155c503cc5fa341946bea8202e..822e7e7c44e06f5b4145406a83be551c4abf3639 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.317 2018/06/06 18:29:18 markus Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.318 2018/07/09 21:59:10 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2255,7 +2255,7 @@ do_gen_krl(struct passwd *pw, int updating, int argc, char **argv)
                fatal("Couldn't generate KRL");
        if ((fd = open(identity_file, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1)
                fatal("open %s: %s", identity_file, strerror(errno));
-       if (atomicio(vwrite, fd, (void *)sshbuf_ptr(kbuf), sshbuf_len(kbuf)) !=
+       if (atomicio(vwrite, fd, sshbuf_mutable_ptr(kbuf), sshbuf_len(kbuf)) !=
            sshbuf_len(kbuf))
                fatal("write %s: %s", identity_file, strerror(errno));
        close(fd);
index 0544b0e860d407465cc305c80f9370462f40bdb0..028b272cb9faf0603d6136d6b38e491fe18759f7 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11-client.c,v 1.9 2018/07/09 20:39:28 markus Exp $ */
+/* $OpenBSD: ssh-pkcs11-client.c,v 1.10 2018/07/09 21:59:10 markus Exp $ */
 /*
  * Copyright (c) 2010 Markus Friedl.  All rights reserved.
  *
@@ -57,7 +57,7 @@ send_msg(struct sshbuf *m)
 
        POKE_U32(buf, mlen);
        if (atomicio(vwrite, fd, buf, 4) != 4 ||
-           atomicio(vwrite, fd, (u_char *)sshbuf_ptr(m),
+           atomicio(vwrite, fd, sshbuf_mutable_ptr(m),
            sshbuf_len(m)) != sshbuf_len(m))
                error("write to helper failed");
        if ((r = sshbuf_consume(m, mlen)) != 0)
index 2c50f75f839e1ce715026c8025d554584ce54afe..aaae7028928c43ec673b160bb70cf93bda4d6cd7 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey-xmss.c,v 1.2 2018/04/10 00:10:49 djm Exp $ */
+/* $OpenBSD: sshkey-xmss.c,v 1.3 2018/07/09 21:59:10 markus Exp $ */
 /*
  * Copyright (c) 2017 Markus Friedl.  All rights reserved.
  *
@@ -625,7 +625,7 @@ sshkey_xmss_update_state(const struct sshkey *k, sshkey_printfn *pr)
                close(fd);
                goto done;
        }
-       if (atomicio(vwrite, fd, (void *)sshbuf_ptr(enc), sshbuf_len(enc)) !=
+       if (atomicio(vwrite, fd, sshbuf_mutable_ptr(enc), sshbuf_len(enc)) !=
            sshbuf_len(enc)) {
                ret = SSH_ERR_SYSTEM_ERROR;
                PRINT("%s: write new state file data: %s", __func__, nstatefile);