summaryrefslogtreecommitdiff
path: root/key.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-12-06 18:00:18 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-12-06 18:00:18 +0000
commit1c37c6a51842f8bed3283ef18ec16cf6a0ae8640 (patch)
treee17ea7a703397ef0b7f7c76d668bb5ac0d4f4fec /key.c
parent3c36bb29ca67d459ef9d8c1961415d77efc20e55 (diff)
- deraadt@cvs.openbsd.org 2001/12/05 10:06:12
[authfd.c authfile.c bufaux.c channels.c compat.c kex.c kexgex.c key.c misc.c packet.c servconf.c ssh-agent.c sshconnect2.c sshconnect.c sshd.c ssh-dss.c ssh-keygen.c ssh-rsa.c] minor KNF
Diffstat (limited to 'key.c')
-rw-r--r--key.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/key.c b/key.c
index 220c476c..87aeefa6 100644
--- a/key.c
+++ b/key.c
@@ -32,7 +32,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
-RCSID("$OpenBSD: key.c,v 1.34 2001/11/21 15:51:24 markus Exp $");
+RCSID("$OpenBSD: key.c,v 1.35 2001/12/05 10:06:12 deraadt Exp $");
#include <openssl/evp.h>
@@ -285,7 +285,7 @@ key_fingerprint(Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep)
dgst_raw = key_fingerprint_raw(k, dgst_type, &dgst_raw_len);
if (!dgst_raw)
fatal("key_fingerprint: null from key_fingerprint_raw()");
- switch(dgst_rep) {
+ switch (dgst_rep) {
case SSH_FP_HEX:
retval = key_fingerprint_hex(dgst_raw, dgst_raw_len);
break;
@@ -371,7 +371,7 @@ key_read(Key *ret, char **cpp)
cp = *cpp;
- switch(ret->type) {
+ switch (ret->type) {
case KEY_RSA1:
/* Get number of bits. */
if (*cp < '0' || *cp > '9')
@@ -533,7 +533,8 @@ key_ssh_name(Key *k)
return "ssh-unknown";
}
u_int
-key_size(Key *k){
+key_size(Key *k)
+{
switch (k->type) {
case KEY_RSA1:
case KEY_RSA:
@@ -616,15 +617,15 @@ key_from_private(Key *k)
int
key_type_from_name(char *name)
{
- if (strcmp(name, "rsa1") == 0){
+ if (strcmp(name, "rsa1") == 0) {
return KEY_RSA1;
- } else if (strcmp(name, "rsa") == 0){
+ } else if (strcmp(name, "rsa") == 0) {
return KEY_RSA;
- } else if (strcmp(name, "dsa") == 0){
+ } else if (strcmp(name, "dsa") == 0) {
return KEY_DSA;
- } else if (strcmp(name, "ssh-rsa") == 0){
+ } else if (strcmp(name, "ssh-rsa") == 0) {
return KEY_RSA;
- } else if (strcmp(name, "ssh-dss") == 0){
+ } else if (strcmp(name, "ssh-dss") == 0) {
return KEY_DSA;
}
debug2("key_type_from_name: unknown key type '%s'", name);
@@ -669,7 +670,7 @@ key_from_blob(u_char *blob, int blen)
ktype = buffer_get_string(&b, NULL);
type = key_type_from_name(ktype);
- switch(type){
+ switch (type) {
case KEY_RSA:
key = key_new(type);
buffer_get_bignum2(&b, key->rsa->e);
@@ -715,7 +716,7 @@ key_to_blob(Key *key, u_char **blobp, u_int *lenp)
return 0;
}
buffer_init(&b);
- switch(key->type){
+ switch (key->type) {
case KEY_DSA:
buffer_put_cstring(&b, key_ssh_name(key));
buffer_put_bignum2(&b, key->dsa->p);
@@ -751,7 +752,7 @@ key_sign(
u_char **sigp, int *lenp,
u_char *data, int datalen)
{
- switch(key->type){
+ switch (key->type) {
case KEY_DSA:
return ssh_dss_sign(key, sigp, lenp, data, datalen);
break;
@@ -774,7 +775,7 @@ key_verify(
if (signaturelen == 0)
return -1;
- switch(key->type){
+ switch (key->type) {
case KEY_DSA:
return ssh_dss_verify(key, signature, signaturelen, data, datalen);
break;