Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.2 KiB

diff --git a/agent/agent.h b/agent/agent.h
index 938a9aa..6431bb2 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -41,6 +41,7 @@
#define GCRY_MODULE_ID_USER 1024
#endif
#define MD_USER_TLS_MD5SHA1 (GCRY_MODULE_ID_USER+1)
+#define MD_USER_TLS_DIGEST (GCRY_MODULE_ID_USER+2)
/* Maximum length of a digest. */
#define MAX_DIGEST_LEN 64
diff --git a/agent/command.c b/agent/command.c
index 2405c54..31e7b93 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -624,6 +624,8 @@ cmd_sethash (assuan_context_t ctx, char *line)
algo = GCRY_MD_MD5;
else if (has_option (line, "--hash=tls-md5sha1"))
algo = MD_USER_TLS_MD5SHA1;
+ else if (has_option (line, "--hash=tls-digest"))
+ algo = MD_USER_TLS_DIGEST;
else
return set_error (GPG_ERR_ASS_PARAMETER, "invalid hash algorithm");
}
@@ -651,6 +653,8 @@ cmd_sethash (assuan_context_t ctx, char *line)
n /= 2;
if (algo == MD_USER_TLS_MD5SHA1 && n == 36)
;
+ else if (algo == MD_USER_TLS_DIGEST && (n == 35 || n == 51))
+ ;
else if (n != 16 && n != 20 && n != 24
&& n != 28 && n != 32 && n != 48 && n != 64)
return set_error (GPG_ERR_ASS_PARAMETER, "unsupported length of hash");
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index 1f36f6e..b3c1301 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -342,7 +342,7 @@ divert_pksign (ctrl_t ctrl,
if (rc)
return rc;
- if (algo == MD_USER_TLS_MD5SHA1)
+ if (algo == MD_USER_TLS_MD5SHA1 || algo == MD_USER_TLS_DIGEST)
{
int save = ctrl->use_auth_call;
ctrl->use_auth_call = 1;
diff --git a/agent/pksign.c b/agent/pksign.c
index 25cadb2..9f19478 100644
--- a/agent/pksign.c
+++ b/agent/pksign.c
@@ -184,7 +184,8 @@ agent_pksign_do (ctrl_t ctrl, const char *desc_text,
gcry_sexp_t s_hash = NULL;
/* Put the hash into a sexp */
- if (ctrl->digest.algo == MD_USER_TLS_MD5SHA1)
+ if (ctrl->digest.algo == MD_USER_TLS_MD5SHA1
+ || ctrl->digest.algo == MD_USER_TLS_DIGEST)
rc = do_encode_raw_pkcs1 (ctrl->digest.value,
ctrl->digest.valuelen,
gcry_pk_get_nbits (s_skey),