net-misc/openssl: Fix building on libressl with USE=hpn
authorPatrick McLean <patrick.mclean@sony.com>
Fri, 26 Oct 2018 18:29:06 +0000 (11:29 -0700)
committerPatrick McLean <chutzpah@gentoo.org>
Fri, 26 Oct 2018 18:29:53 +0000 (11:29 -0700)
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

net-misc/openssh/files/openssh-7.9_p1-hpn-openssl-1.1.patch

index 524d05ad89d5ec7b2d8766ddf1893e2a5af5c4e1..c07ad0414ef510605361b7ce223e8471ff53f611 100644 (file)
@@ -1,13 +1,13 @@
 --- openssh-7.9p1.orig/cipher-ctr-mt.c 2018-10-24 20:48:00.909255466 -0000
 +++ openssh-7.9p1/cipher-ctr-mt.c      2018-10-24 20:48:17.378155144 -0000
 @@ -46,7 +46,7 @@
- 
+
  /*-------------------- TUNABLES --------------------*/
  /* maximum number of threads and queues */
 -#define MAX_THREADS      32
-+#define MAX_THREADS      32 
++#define MAX_THREADS      32
  #define MAX_NUMKQ        (MAX_THREADS * 2)
- 
+
  /* Number of pregen threads to use */
 @@ -435,7 +435,7 @@
                destp.u += AES_BLOCK_SIZE;
@@ -15,7 +15,7 @@
                len -= AES_BLOCK_SIZE;
 -              ssh_ctr_inc(ctx->iv, AES_BLOCK_SIZE);
 +              ssh_ctr_inc(c->aes_counter, AES_BLOCK_SIZE);
- 
+
                /* Increment read index, switch queues on rollover */
                if ((ridx = (ridx + 1) % KQLEN) == 0) {
 @@ -481,8 +481,6 @@
@@ -28,9 +28,9 @@
        cipher_threads = sysconf(_SC_NPROCESSORS_ONLN) / 2;
  #endif /*__linux__*/
 @@ -505,11 +503,12 @@
-       if (cipher_threads < 2) 
+       if (cipher_threads < 2)
                cipher_threads = 2;
-               
+
 -        /* assure that we aren't trying to create more threads than we have in the struct */
 -      /* cipher_threads is half the total of allowable threads hence the odd looking math here */
 +      /* assure that we aren't trying to create more threads */
 +      /* total of allowable threads hence the odd looking math here */
        if (cipher_threads * 2 > MAX_THREADS)
                cipher_threads = MAX_THREADS / 2;
--      
+-
 +
        /* set the number of keystream queues */
        numkq = cipher_threads * 2;
- 
+
 @@ -551,16 +550,16 @@
        }
- 
+
        if (iv != NULL) {
 -              memcpy(ctx->iv, iv, AES_BLOCK_SIZE);
 +              memcpy(c->aes_counter, iv, AES_BLOCK_SIZE);
                c->state |= HAVE_IV;
        }
- 
+
        if (c->state == (HAVE_KEY | HAVE_IV)) {
                /* Clear queues */
 -              memcpy(c->q[0].ctr, ctx->iv, AES_BLOCK_SIZE);
@@ -67,7 +67,7 @@
  const EVP_CIPHER *
  evp_aes_ctr_mt(void)
  {
-+# if OPENSSL_VERSION_NUMBER >= 0x10100000UL
++# if OPENSSL_VERSION_NUMBER >= 0x10100000UL && !defined(LIBRESSL_VERSION_NUMBER)
 +      static EVP_CIPHER *aes_ctr;
 +      aes_ctr = EVP_CIPHER_meth_new(NID_undef, 16/*block*/, 16/*key*/);
 +      EVP_CIPHER_meth_set_iv_length(aes_ctr, AES_BLOCK_SIZE);
 +        return &aes_ctr;
 +# endif /*OPENSSH_VERSION_NUMBER*/
  }
- 
+
  #endif /* defined(WITH_OPENSSL) */