[openssh-commits] [openssh] 02/02: Conditionally compile XMSS code.

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Feb 28 17:00:16 AEDT 2018


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit a10d8552d0d2438da4ed539275abcbf557d1e7a8
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Tue Feb 27 14:45:17 2018 +1100

    Conditionally compile XMSS code.
    
    The XMSS code is currently experimental and, unlike the rest of OpenSSH
    cannot currently be compiled with a c89 compiler.
---
 sshkey-xmss.c       | 2 ++
 xmss_commons.c      | 2 ++
 xmss_commons.h      | 2 ++
 xmss_fast.c         | 2 ++
 xmss_fast.h         | 3 ++-
 xmss_hash.c         | 2 ++
 xmss_hash.h         | 2 ++
 xmss_hash_address.c | 2 ++
 xmss_hash_address.h | 4 ++--
 xmss_wots.c         | 2 ++
 xmss_wots.h         | 2 ++
 11 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/sshkey-xmss.c b/sshkey-xmss.c
index f146098b..e2b7c49c 100644
--- a/sshkey-xmss.c
+++ b/sshkey-xmss.c
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /* $OpenBSD: sshkey-xmss.c,v 1.1 2018/02/23 15:58:38 markus Exp $ */
 /*
  * Copyright (c) 2017 Markus Friedl.  All rights reserved.
@@ -1051,3 +1052,4 @@ sshkey_xmss_enable_maxsign(struct sshkey *k, u_int32_t maxsign)
 	state->maxidx = state->idx + maxsign;
 	return 0;
 }
+#endif /* WITH_XMSS */
diff --git a/xmss_commons.c b/xmss_commons.c
index ff3ddb4a..a25fc673 100644
--- a/xmss_commons.c
+++ b/xmss_commons.c
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 xmss_commons.c 20160722
 Andreas Hülsing
@@ -31,3 +32,4 @@ void hexdump(const unsigned char *a, size_t len)
     printf("%02x", a[i]);
 }
 #endif
+#endif /* WITH_XMSS */
diff --git a/xmss_commons.h b/xmss_commons.h
index d9a920c0..a79ba11e 100644
--- a/xmss_commons.h
+++ b/xmss_commons.h
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 xmss_commons.h 20160722
 Andreas Hülsing
@@ -17,3 +18,4 @@ void to_byte(unsigned char *output, unsigned long long in, uint32_t bytes);
 void hexdump(const unsigned char *a, size_t len);
 #endif
 #endif
+#endif /* WITH_XMSS */
diff --git a/xmss_fast.c b/xmss_fast.c
index b918f135..5e3a5431 100644
--- a/xmss_fast.c
+++ b/xmss_fast.c
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 xmss_fast.c version 20160722
 Andreas Hülsing
@@ -1101,3 +1102,4 @@ fail:
   *msglen = -1;
   return -1;
 }
+#endif /* WITH_XMSS */
diff --git a/xmss_fast.h b/xmss_fast.h
index 657cd27f..52a83f86 100644
--- a/xmss_fast.h
+++ b/xmss_fast.h
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 xmss_fast.h version 20160722
 Andreas Hülsing
@@ -106,4 +107,4 @@ int xmssmt_sign(unsigned char *sk, bds_state *state, unsigned char *wots_sigs, u
  */
 int xmssmt_sign_open(unsigned char *msg, unsigned long long *msglen, const unsigned char *sig_msg, unsigned long long sig_msg_len, const unsigned char *pk, const xmssmt_params *params);
 #endif
-
+#endif /* WITH_XMSS */
diff --git a/xmss_hash.c b/xmss_hash.c
index c4cac47f..c8b27116 100644
--- a/xmss_hash.c
+++ b/xmss_hash.c
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 hash.c version 20160722
 Andreas Hülsing
@@ -135,3 +136,4 @@ int hash_f(unsigned char *out, const unsigned char *in, const unsigned char *pub
   }
   return core_hash_SHA2(out, 0, key, n, buf, n, n);
 }
+#endif /* WITH_XMSS */
diff --git a/xmss_hash.h b/xmss_hash.h
index 2fed7300..e01960cd 100644
--- a/xmss_hash.h
+++ b/xmss_hash.h
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 hash.h version 20160722
 Andreas Hülsing
@@ -17,3 +18,4 @@ int hash_h(unsigned char *out, const unsigned char *in, const unsigned char *pub
 int hash_f(unsigned char *out, const unsigned char *in, const unsigned char *pub_seed, uint32_t addr[8], const unsigned int n);
 
 #endif
+#endif /* WITH_XMSS */
diff --git a/xmss_hash_address.c b/xmss_hash_address.c
index 0ff4fdb5..b970619e 100644
--- a/xmss_hash_address.c
+++ b/xmss_hash_address.c
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 hash_address.c version 20160722
 Andreas Hülsing
@@ -61,3 +62,4 @@ void setTreeHeight(uint32_t adrs[8], uint32_t treeHeight){
 void setTreeIndex(uint32_t adrs[8], uint32_t treeIndex){
   adrs[6] = treeIndex;
 }
+#endif /* WITH_XMSS */
diff --git a/xmss_hash_address.h b/xmss_hash_address.h
index 2bf43408..7381aab0 100644
--- a/xmss_hash_address.h
+++ b/xmss_hash_address.h
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 hash_address.h version 20160722
 Andreas Hülsing
@@ -35,5 +36,4 @@ void setTreeHeight(uint32_t adrs[8], uint32_t treeHeight);
 
 void setTreeIndex(uint32_t adrs[8], uint32_t treeIndex);
 
-
-
+#endif /* WITH_XMSS */
diff --git a/xmss_wots.c b/xmss_wots.c
index 9f1900fc..8e0c07be 100644
--- a/xmss_wots.c
+++ b/xmss_wots.c
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 wots.c version 20160722
 Andreas Hülsing
@@ -187,3 +188,4 @@ int wots_pkFromSig(unsigned char *pk, const unsigned char *sig, const unsigned c
   free(basew);
   return 0;
 }
+#endif /* WITH_XMSS */
diff --git a/xmss_wots.h b/xmss_wots.h
index 8bcb44e0..6b3177c2 100644
--- a/xmss_wots.h
+++ b/xmss_wots.h
@@ -1,3 +1,4 @@
+#ifdef WITH_XMSS
 /*
 wots.h version 20160722
 Andreas Hülsing
@@ -59,3 +60,4 @@ int wots_sign(unsigned char *sig, const unsigned char *msg, const unsigned char
 int wots_pkFromSig(unsigned char *pk, const unsigned char *sig, const unsigned char *msg, const wots_params *params, const unsigned char *pub_seed, uint32_t addr[8]);
 
 #endif
+#endif /* WITH_XMSS */

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list