diff options
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$Id: authfd.c,v 1.8 1999/11/25 00:54:57 damien Exp $"); | 17 | RCSID("$Id: authfd.c,v 1.9 1999/12/07 04:38:32 damien Exp $"); |
18 | 18 | ||
19 | #include "ssh.h" | 19 | #include "ssh.h" |
20 | #include "rsa.h" | 20 | #include "rsa.h" |
@@ -145,7 +145,7 @@ ssh_get_first_identity(AuthenticationConnection *auth, | |||
145 | msg[2] = 0; | 145 | msg[2] = 0; |
146 | msg[3] = 1; | 146 | msg[3] = 1; |
147 | msg[4] = SSH_AGENTC_REQUEST_RSA_IDENTITIES; | 147 | msg[4] = SSH_AGENTC_REQUEST_RSA_IDENTITIES; |
148 | if (write(auth->fd, msg, 5) != 5) { | 148 | if (atomicio(write, auth->fd, msg, 5) != 5) { |
149 | error("write auth->fd: %.100s", strerror(errno)); | 149 | error("write auth->fd: %.100s", strerror(errno)); |
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
@@ -270,9 +270,9 @@ ssh_decrypt_challenge(AuthenticationConnection *auth, | |||
270 | PUT_32BIT(buf, len); | 270 | PUT_32BIT(buf, len); |
271 | 271 | ||
272 | /* Send the length and then the packet to the agent. */ | 272 | /* Send the length and then the packet to the agent. */ |
273 | if (write(auth->fd, buf, 4) != 4 || | 273 | if (atomicio(write, auth->fd, buf, 4) != 4 || |
274 | write(auth->fd, buffer_ptr(&buffer), buffer_len(&buffer)) != | 274 | atomicio(write, auth->fd, buffer_ptr(&buffer), |
275 | buffer_len(&buffer)) { | 275 | buffer_len(&buffer)) != buffer_len(&buffer)) { |
276 | error("Error writing to authentication socket."); | 276 | error("Error writing to authentication socket."); |
277 | error_cleanup: | 277 | error_cleanup: |
278 | buffer_free(&buffer); | 278 | buffer_free(&buffer); |
@@ -369,9 +369,9 @@ ssh_add_identity(AuthenticationConnection *auth, | |||
369 | PUT_32BIT(buf, len); | 369 | PUT_32BIT(buf, len); |
370 | 370 | ||
371 | /* Send the length and then the packet to the agent. */ | 371 | /* Send the length and then the packet to the agent. */ |
372 | if (write(auth->fd, buf, 4) != 4 || | 372 | if (atomicio(write, auth->fd, buf, 4) != 4 || |
373 | write(auth->fd, buffer_ptr(&buffer), buffer_len(&buffer)) != | 373 | atomicio(write, auth->fd, buffer_ptr(&buffer), |
374 | buffer_len(&buffer)) { | 374 | buffer_len(&buffer)) != buffer_len(&buffer)) { |
375 | error("Error writing to authentication socket."); | 375 | error("Error writing to authentication socket."); |
376 | error_cleanup: | 376 | error_cleanup: |
377 | buffer_free(&buffer); | 377 | buffer_free(&buffer); |
@@ -450,9 +450,9 @@ ssh_remove_identity(AuthenticationConnection *auth, RSA *key) | |||
450 | PUT_32BIT(buf, len); | 450 | PUT_32BIT(buf, len); |
451 | 451 | ||
452 | /* Send the length and then the packet to the agent. */ | 452 | /* Send the length and then the packet to the agent. */ |
453 | if (write(auth->fd, buf, 4) != 4 || | 453 | if (atomicio(write, auth->fd, buf, 4) != 4 || |
454 | write(auth->fd, buffer_ptr(&buffer), buffer_len(&buffer)) != | 454 | atomicio(write, auth->fd, buffer_ptr(&buffer), |
455 | buffer_len(&buffer)) { | 455 | buffer_len(&buffer)) != buffer_len(&buffer)) { |
456 | error("Error writing to authentication socket."); | 456 | error("Error writing to authentication socket."); |
457 | error_cleanup: | 457 | error_cleanup: |
458 | buffer_free(&buffer); | 458 | buffer_free(&buffer); |
@@ -526,7 +526,7 @@ ssh_remove_all_identities(AuthenticationConnection *auth) | |||
526 | buf[4] = SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES; | 526 | buf[4] = SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES; |
527 | 527 | ||
528 | /* Send the length and then the packet to the agent. */ | 528 | /* Send the length and then the packet to the agent. */ |
529 | if (write(auth->fd, buf, 5) != 5) { | 529 | if (atomicio(write, auth->fd, buf, 5) != 5) { |
530 | error("Error writing to authentication socket."); | 530 | error("Error writing to authentication socket."); |
531 | return 0; | 531 | return 0; |
532 | } | 532 | } |