#include #include #include #include #include #include "rnd.h" #include "die.h" #include "str.h" #include "crypto.h" #include "curve.h" #include "ioops.h" #include "config.h" #include "keypair.h" void generate_keypair(void) { struct passwd *pw = getpwuid(getuid()); unsigned char publickey[crypto_box_pub_key_size]; unsigned char secretkey[crypto_box_sec_key_size]; char file[128]; xmemset(publickey, 0, sizeof(publickey)); xmemset(secretkey, 0, sizeof(secretkey)); curve25519_selftest(); printf("Reading from %s (this may take a while) ...\n", HIG_ENTROPY_SOURCE); gen_key_bytes(secretkey, sizeof(secretkey)); crypto_scalarmult_curve25519_base(publickey, secretkey); slprintf(file, sizeof(file), "%s/%s", pw->pw_dir, FILE_PUBKEY); write_blob_or_die(file, publickey, sizeof(publickey)); printf("Public key written to %s!\n", file); slprintf(file, sizeof(file), "%s/%s", pw->pw_dir, FILE_PRIVKEY); write_blob_or_die(file, secretkey, sizeof(secretkey)); printf("Secret key written to %s!\n", file); xmemset(publickey, 0, sizeof(publickey)); xmemset(secretkey, 0, sizeof(secretkey)); } void verify_keypair(void) { int result; struct passwd *pw = getpwuid(getuid()); unsigned char publickey[crypto_box_pub_key_size]; unsigned char publicres[crypto_box_pub_key_size]; unsigned char secretkey[crypto_box_sec_key_size]; char file[128]; curve25519_selftest(); xmemset(publickey, 0, sizeof(publickey)); xmemset(publicres, 0, sizeof(publicres)); xmemset(secretkey, 0, sizeof(secretkey)); slprintf(file, sizeof(file), "%s/%s", pw->pw_dir, FILE_PUBKEY); read_blob_or_die(file, publickey, sizeof(publickey)); slprintf(file, sizeof(file), "%s/%s", pw->pw_dir, FILE_PRIVKEY); read_blob_or_die(file, secretkey, sizeof(secretkey)); crypto_scalarmult_curve25519_base(publicres, secretkey); result = crypto_verify_32(publicres, publickey); xmemset(publickey, 0, sizeof(publickey)); xmemset(publicres, 0, sizeof(publicres)); xmemset(secretkey, 0, sizeof(secretkey)); if (result) panic("Keypair is corrupt! You need to regenerate!\n"); } f/?h=nds-private-remove&id=9aff212bd677829189fae2e2e408cefc196ae5ae'>diff
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-09-23 12:39:23 +0100
committerDavid Howells <dhowells@redhat.com>2016-09-23 13:23:09 +0100
commit9aff212bd677829189fae2e2e408cefc196ae5ae (patch)
tree9f042ceba0cb1ff2ab30400fa5f0b474e7ff5c31
parentb24d2891cfb0a7975b0039743439c98fe7b7dea7 (diff)
rxrpc: Don't send an ACK at the end of service call response transmission
Don't send an IDLE ACK at the end of the transmission of the response to a service call. The service end resends DATA packets until the client sends an ACK that hard-acks all the send data. At that point, the call is complete. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--net/rxrpc/recvmsg.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c