Lines Matching defs:hashalg
162 sshsig_wrap_sign(struct sshkey *key, const char *hashalg,
184 (r = sshbuf_put_cstring(tosign, hashalg)) != 0 ||
193 if (strcmp(hashalg, "sha256") == 0)
195 else if (strcmp(hashalg, "sha512") == 0)
220 (r = sshbuf_put_cstring(blob, hashalg)) != 0 ||
261 sshsig_check_hashalg(const char *hashalg)
263 if (hashalg == NULL ||
264 match_pattern_list(hashalg, HASHALG_ALLOWED, 0) == 1)
266 error_f("unsupported hash algorithm \"%.100s\"", hashalg);
274 char *hashalg = NULL;
286 (r = sshbuf_get_cstring(buf, &hashalg, NULL)) != 0 ||
294 *hashalgp = hashalg;
295 hashalg = NULL;
297 free(hashalg);
303 sshsig_wrap_verify(struct sshbuf *signature, const char *hashalg,
329 (r = sshbuf_put_cstring(toverify, hashalg)) != 0 ||
360 if (strcmp(hashalg, sig_hashalg) != 0) {
363 hashalg, sig_hashalg);
404 hash_buffer(const struct sshbuf *m, const char *hashalg, struct sshbuf **bp)
413 if ((r = sshsig_check_hashalg(hashalg)) != 0)
415 if ((alg = ssh_digest_alg_by_name(hashalg)) == -1) {
416 error_f("can't look up hash algorithm %s", hashalg);
446 sshsig_signb(struct sshkey *key, const char *hashalg,
454 if (hashalg == NULL)
455 hashalg = HASHALG_DEFAULT;
458 if ((r = hash_buffer(message, hashalg, &b)) != 0) {
462 if ((r = sshsig_wrap_sign(key, hashalg, sk_provider, sk_pin, b,
479 char *hashalg = NULL;
485 if ((r = sshsig_peek_hashalg(signature, &hashalg)) != 0)
487 debug_f("signature made with hash \"%s\"", hashalg);
488 if ((r = hash_buffer(message, hashalg, &b)) != 0) {
492 if ((r = sshsig_wrap_verify(signature, hashalg, b, expect_namespace,
499 free(hashalg);
504 hash_file(int fd, const char *hashalg, struct sshbuf **bp)
515 if ((r = sshsig_check_hashalg(hashalg)) != 0)
517 if ((alg = ssh_digest_alg_by_name(hashalg)) == -1) {
518 error_f("can't look up hash algorithm %s", hashalg);
574 sshsig_sign_fd(struct sshkey *key, const char *hashalg,
582 if (hashalg == NULL)
583 hashalg = HASHALG_DEFAULT;
586 if ((r = hash_file(fd, hashalg, &b)) != 0) {
590 if ((r = sshsig_wrap_sign(key, hashalg, sk_provider, sk_pin, b,
607 char *hashalg = NULL;
613 if ((r = sshsig_peek_hashalg(signature, &hashalg)) != 0)
615 debug_f("signature made with hash \"%s\"", hashalg);
616 if ((r = hash_file(fd, hashalg, &b)) != 0) {
620 if ((r = sshsig_wrap_verify(signature, hashalg, b, expect_namespace,
627 free(hashalg);