Lines Matching refs:key

69 ssh_xmss_serialize_public(const struct sshkey *key, struct sshbuf *b,  in ssh_xmss_serialize_public()  argument
74 if (key->xmss_name == NULL || key->xmss_pk == NULL || in ssh_xmss_serialize_public()
75 sshkey_xmss_pklen(key) == 0) in ssh_xmss_serialize_public()
77 if ((r = sshbuf_put_cstring(b, key->xmss_name)) != 0 || in ssh_xmss_serialize_public()
78 (r = sshbuf_put_string(b, key->xmss_pk, in ssh_xmss_serialize_public()
79 sshkey_xmss_pklen(key))) != 0 || in ssh_xmss_serialize_public()
80 (r = sshkey_xmss_serialize_pk_info(key, b, opts)) != 0) in ssh_xmss_serialize_public()
87 ssh_xmss_serialize_private(const struct sshkey *key, struct sshbuf *b, in ssh_xmss_serialize_private() argument
92 if (key->xmss_name == NULL) in ssh_xmss_serialize_private()
95 if ((r = sshbuf_put_cstring(b, key->xmss_name)) != 0 || in ssh_xmss_serialize_private()
96 (r = sshbuf_put_string(b, key->xmss_pk, in ssh_xmss_serialize_private()
97 sshkey_xmss_pklen(key))) != 0 || in ssh_xmss_serialize_private()
98 (r = sshbuf_put_string(b, key->xmss_sk, in ssh_xmss_serialize_private()
99 sshkey_xmss_sklen(key))) != 0 || in ssh_xmss_serialize_private()
100 (r = sshkey_xmss_serialize_state_opt(key, b, opts)) != 0) in ssh_xmss_serialize_private()
133 struct sshkey *key) in ssh_xmss_deserialize_public() argument
142 if ((ret = sshkey_xmss_init(key, xmss_name)) != 0) in ssh_xmss_deserialize_public()
146 if (len == 0 || len != sshkey_xmss_pklen(key)) { in ssh_xmss_deserialize_public()
150 key->xmss_pk = pk; in ssh_xmss_deserialize_public()
152 if (!sshkey_is_cert(key) && in ssh_xmss_deserialize_public()
153 (ret = sshkey_xmss_deserialize_pk_info(key, b)) != 0) in ssh_xmss_deserialize_public()
165 struct sshkey *key) in ssh_xmss_deserialize_private() argument
177 if (!sshkey_is_cert(key) && in ssh_xmss_deserialize_private()
178 (r = sshkey_xmss_init(key, xmss_name)) != 0) in ssh_xmss_deserialize_private()
180 if (pklen != sshkey_xmss_pklen(key) || in ssh_xmss_deserialize_private()
181 sklen != sshkey_xmss_sklen(key)) { in ssh_xmss_deserialize_private()
185 key->xmss_pk = xmss_pk; in ssh_xmss_deserialize_private()
186 key->xmss_sk = xmss_sk; in ssh_xmss_deserialize_private()
189 if ((r = sshkey_xmss_deserialize_state_opt(key, b)) != 0) in ssh_xmss_deserialize_private()
201 ssh_xmss_sign(struct sshkey *key, in ssh_xmss_sign() argument
217 if (key == NULL || in ssh_xmss_sign()
218 sshkey_type_plain(key->type) != KEY_XMSS || in ssh_xmss_sign()
219 key->xmss_sk == NULL || in ssh_xmss_sign()
220 sshkey_xmss_params(key) == NULL) in ssh_xmss_sign()
222 if ((r = sshkey_xmss_siglen(key, &required_siglen)) != 0) in ssh_xmss_sign()
229 if ((r = sshkey_xmss_get_state(key, 1)) != 0) in ssh_xmss_sign()
231 if ((ret = xmss_sign(key->xmss_sk, sshkey_xmss_bds_state(key), sig, &smlen, in ssh_xmss_sign()
232 data, datalen, sshkey_xmss_params(key))) != 0 || smlen <= datalen) { in ssh_xmss_sign()
257 if ((ret = sshkey_xmss_update_state(key, 1)) != 0) { in ssh_xmss_sign()
277 ssh_xmss_verify(const struct sshkey *key, in ssh_xmss_verify() argument
290 if (key == NULL || in ssh_xmss_verify()
291 sshkey_type_plain(key->type) != KEY_XMSS || in ssh_xmss_verify()
292 key->xmss_pk == NULL || in ssh_xmss_verify()
293 sshkey_xmss_params(key) == NULL || in ssh_xmss_verify()
296 if ((r = sshkey_xmss_siglen(key, &required_siglen)) != 0) in ssh_xmss_verify()
331 key->xmss_pk, sshkey_xmss_params(key))) != 0) { in ssh_xmss_verify()