Displaying 3 results from an estimated 3 matches for "ssh_digest_max".
2014 Jul 15
2
missing HAVE_EVP_RIPEMD160 breaks ssh client
...h local if missing */
{ SSH_DIGEST_RIPEMD160, "RIPEMD160", 20, EVP_ripemd160 },
#endif
{ SSH_DIGEST_SHA1, "SHA1", 20, EVP_sha1 },
...
Would it be worth to use enum instead of defined constants for the digest type?
--- a/digest.h
+++ b/digest.h
@@ -22,13 +22,17 @@
#define SSH_DIGEST_MAX_LENGTH 64
/* Digest algorithms */
-#define SSH_DIGEST_MD5 0
-#define SSH_DIGEST_RIPEMD160 1
-#define SSH_DIGEST_SHA1 2
-#define SSH_DIGEST_SHA256 3
-#define SSH_DIGEST_SHA384 4
-#define SSH_DIGEST_SHA512 5
-#define SSH_DIGEST_MAX 6
+enum ssh_digest...
2024 Aug 06
1
[PATCH] Add SM3 secure hash algorithm
...00644
--- a/digest-libc.c
+++ b/digest-libc.c
@@ -46,6 +46,7 @@
#define SHA512_BLOCK_LENGTH SHA512_HMAC_BLOCK_SIZE
#endif
+#include "sm3.h"
#include "ssherr.h"
#include "sshbuf.h"
#include "digest.h"
@@ -121,6 +122,16 @@ const struct ssh_digest digests[SSH_DIGEST_MAX] = {
(md_init_fn *) SHA512Init,
(md_update_fn *) SHA512Update,
(md_final_fn *) SHA512Final
+ },
+ {
+ SSH_DIGEST_SM3,
+ "SM3",
+ SM3_BLOCK_LENGTH,
+ SM3_DIGEST_LENGTH,
+ sizeof(SM3_CTX),
+ (md_init_fn *) SM3Init,
+ (md_update_fn *) SM3Update,
+ (md_final_fn *) SM3Final...
2024 Aug 07
1
[PATCH] Add SM3 secure hash algorithm
...> @@ -46,6 +46,7 @@
> #define SHA512_BLOCK_LENGTH SHA512_HMAC_BLOCK_SIZE
> #endif
>
> +#include "sm3.h"
> #include "ssherr.h"
> #include "sshbuf.h"
> #include "digest.h"
> @@ -121,6 +122,16 @@ const struct ssh_digest digests[SSH_DIGEST_MAX] = {
> (md_init_fn *) SHA512Init,
> (md_update_fn *) SHA512Update,
> (md_final_fn *) SHA512Final
> + },
> + {
> + SSH_DIGEST_SM3,
> + "SM3",
> + SM3_BLOCK_LENGTH,
> + SM3_DIGEST_LENGTH,
> + sizeof(SM3_CTX),
> + (md_init_fn *) SM3Init,
> +...