=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshkey.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- src/usr.bin/ssh/sshkey.c 2019/07/16 13:18:39 1.81 +++ src/usr.bin/ssh/sshkey.c 2019/09/03 08:31:20 1.82 @@ -1,4 +1,4 @@ -/* $OpenBSD: sshkey.c,v 1.81 2019/07/16 13:18:39 djm Exp $ */ +/* $OpenBSD: sshkey.c,v 1.82 2019/09/03 08:31:20 djm Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * Copyright (c) 2008 Alexander von Gernler. All rights reserved. @@ -84,7 +84,6 @@ struct sshbuf *buf, enum sshkey_serialize_rep); static int sshkey_from_blob_internal(struct sshbuf *buf, struct sshkey **keyp, int allow_cert); -static int get_sigtype(const u_char *sig, size_t siglen, char **sigtypep); /* Supported key types */ struct keytype { @@ -2158,7 +2157,8 @@ if ((ret = sshkey_verify(key->cert->signature_key, sig, slen, sshbuf_ptr(key->cert->certblob), signed_len, NULL, 0)) != 0) goto out; - if ((ret = get_sigtype(sig, slen, &key->cert->signature_type)) != 0) + if ((ret = sshkey_get_sigtype(sig, slen, + &key->cert->signature_type)) != 0) goto out; /* Success */ @@ -2452,8 +2452,8 @@ return r; } -static int -get_sigtype(const u_char *sig, size_t siglen, char **sigtypep) +int +sshkey_get_sigtype(const u_char *sig, size_t siglen, char **sigtypep) { int r; struct sshbuf *b = NULL; @@ -2535,7 +2535,7 @@ return 0; if ((expected_alg = sshkey_sigalg_by_name(requested_alg)) == NULL) return SSH_ERR_INVALID_ARGUMENT; - if ((r = get_sigtype(sig, siglen, &sigtype)) != 0) + if ((r = sshkey_get_sigtype(sig, siglen, &sigtype)) != 0) return r; r = strcmp(expected_alg, sigtype) == 0; free(sigtype); @@ -2805,7 +2805,7 @@ sshbuf_len(cert), alg, 0, signer_ctx)) != 0) goto out; /* Check and update signature_type against what was actually used */ - if ((ret = get_sigtype(sig_blob, sig_len, &sigtype)) != 0) + if ((ret = sshkey_get_sigtype(sig_blob, sig_len, &sigtype)) != 0) goto out; if (alg != NULL && strcmp(alg, sigtype) != 0) { ret = SSH_ERR_SIGN_ALG_UNSUPPORTED;