]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge topic branch t/crypt-cleanups into master
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 24 Dec 2023 15:43:04 +0000 (16:43 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 24 Dec 2023 15:45:34 +0000 (16:45 +0100)
This bunch of mostry trivial changes can be merged early, before the
openssl code is converted to use the EVP API. The topic was cooking
in next for six months.

* refs/heads/t/crypt-cleanups:
  openssl: Assign bignums in canonical order.
  openssl: Unify naming of public key structures.
  openssl: Rename read_private_rsa_params() -> read_openssh_private_key().
  openssl: Rename read_rsa_bignums() -> read_public_key().
  openssl: Dedox crypt_init().
  server: Improve "loading pubkey" log message.
  gcrypt: Remove pointless state variable.
  client: Reduce line length.

1  2 
NEWS.md
client_common.c

diff --combined NEWS.md
index 5430790bcc151fa90c93eabe66c009a1592c994f,a259ef3e140ceeb5649217c903ee6820a973a0f0..4b718d8a6b396ee143fd7de65d9b49f32f0f0dd4
+++ b/NEWS.md
@@@ -11,15 -11,6 +11,16 @@@ NEW
  - Version 1.0 of the openssl library has been deprecated. A warning
    is printed at compile-time on systems which have this outdated version
    because it will no longer be supported once paraslash-0.8.0 comes out.
 +- A spring cleanup for the senescent code in fd.c.
 +- The --admissible option of the ls command now takes an optional
 +  argument. When invoked like --admissible=m/foo, only files which are
 +  admissible with respect to mood foo are listed.
 +- The select server command is now quiet by default, The new --verbose
 +  option can be used to show information about the newly loaded mood
 +  or playlist.
 +- The ls server command gained the --limit option to force a limit
 +  on the number of files listed.
++- Cleanup of the openssl-specific code.
  
  Downloads:
  [tarball](./releases/paraslash-git.tar.xz)
diff --combined client_common.c
index 3b90000f90ccdcc64be78e98e564bddc9cff3adb,eeb47c6053ec071a0ff3ed8bed3d4a75fcec4aef..fe8234f98fe90f6ce74ea5e22699fbfc0059a042
@@@ -344,15 -344,18 +344,18 @@@ static int client_post_monitor(struct s
                        goto out;
                ct->challenge_hash = alloc(HASH2_SIZE);
                if (has_feature("sha256", ct)) {
-                       hash2_function((char *)crypt_buf, APC_CHALLENGE_SIZE, ct->challenge_hash);
+                       hash2_function((char *)crypt_buf, APC_CHALLENGE_SIZE,
+                               ct->challenge_hash);
                        hash2_to_asc(ct->challenge_hash, buf);
                } else {
-                       hash_function((char *)crypt_buf, APC_CHALLENGE_SIZE, ct->challenge_hash);
+                       hash_function((char *)crypt_buf, APC_CHALLENGE_SIZE,
+                               ct->challenge_hash);
                        hash_to_asc(ct->challenge_hash, buf);
                }
-               ct->scc.send = sc_new(crypt_buf + APC_CHALLENGE_SIZE, SESSION_KEY_LEN);
-               ct->scc.recv = sc_new(crypt_buf + APC_CHALLENGE_SIZE + SESSION_KEY_LEN,
-                       SESSION_KEY_LEN);
+               ct->scc.send = sc_new(crypt_buf + APC_CHALLENGE_SIZE,
+                        SESSION_KEY_LEN);
+               ct->scc.recv = sc_new(crypt_buf + APC_CHALLENGE_SIZE
+                       + SESSION_KEY_LEN, SESSION_KEY_LEN);
                PARA_INFO_LOG("--> %s\n", buf);
                ct->status = CL_RECEIVED_CHALLENGE;
                return 0;
@@@ -578,9 -581,8 +581,9 @@@ int client_parse_config(int argc, char 
        if (CLIENT_OPT_GIVEN(KEY_FILE, lpr))
                kf = para_strdup(CLIENT_OPT_STRING_VAL(KEY_FILE, lpr));
        else {
 +              struct stat statbuf;
                kf = make_message("%s/.paraslash/key.%s", home, user);
 -              if (!file_exists(kf)) {
 +              if (stat(kf, &statbuf) != 0) { /* assume file does not exist */
                        free(kf);
                        kf = make_message("%s/.ssh/id_rsa", home);
                }