mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-05 00:00:45 -04:00
Some whitespace fixes.
This commit is contained in:
parent
e41932320c
commit
0a4dc78755
@ -249,7 +249,7 @@ static bool get_encoding(private_openssl_ec_private_key_t *this,
|
||||
NULL, encoding, KEY_PART_ECDSA_PRIV_ASN1_DER,
|
||||
asn1_encoding, KEY_PART_END);
|
||||
chunk_clear(&asn1_encoding);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
default:
|
||||
|
@ -264,7 +264,7 @@ static bool get_encoding(private_openssl_ec_public_key_t *this,
|
||||
NULL, encoding, KEY_PART_ECDSA_PUB_ASN1_DER,
|
||||
asn1_encoding, KEY_PART_END);
|
||||
chunk_clear(&asn1_encoding);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
default:
|
||||
|
@ -242,7 +242,7 @@ static bool get_encoding(private_openssl_rsa_private_key_t *this,
|
||||
NULL, encoding, KEY_PART_RSA_PRIV_ASN1_DER,
|
||||
asn1_encoding, KEY_PART_END);
|
||||
chunk_clear(&asn1_encoding);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
default:
|
||||
|
@ -247,7 +247,7 @@ static bool get_encoding(private_openssl_rsa_public_key_t *this,
|
||||
NULL, encoding, KEY_PART_RSA_PUB_ASN1_DER,
|
||||
asn1_encoding, KEY_PART_END);
|
||||
chunk_clear(&asn1_encoding);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
case KEY_PUB_ASN1_DER:
|
||||
|
@ -60,7 +60,7 @@ bool pem_encoder_encode(key_encoding_type_t type, chunk_t *encoding,
|
||||
|
||||
/* compute and allocate maximum size of PEM object */
|
||||
pem_chars = 4*(asn1.len + 2)/3;
|
||||
pem_lines = (asn1.len + BYTES_PER_LINE - 1) / BYTES_PER_LINE;
|
||||
pem_lines = (asn1.len + BYTES_PER_LINE - 1) / BYTES_PER_LINE;
|
||||
*encoding = chunk_alloc(5 + 2*(6 + strlen(label) + 6) + 3 + pem_chars + pem_lines);
|
||||
pos = encoding->ptr;
|
||||
len = encoding->len;
|
||||
@ -68,7 +68,7 @@ bool pem_encoder_encode(key_encoding_type_t type, chunk_t *encoding,
|
||||
/* write PEM header */
|
||||
written = snprintf(pos, len, "-----BEGIN %s-----\n", label);
|
||||
pos += written;
|
||||
len -= written;
|
||||
len -= written;
|
||||
|
||||
/* write PEM body */
|
||||
while (pem_lines--)
|
||||
@ -89,10 +89,10 @@ bool pem_encoder_encode(key_encoding_type_t type, chunk_t *encoding,
|
||||
/* write PEM trailer */
|
||||
written = snprintf(pos, len, "-----END %s-----", label);
|
||||
pos += written;
|
||||
len -= written;
|
||||
len -= written;
|
||||
|
||||
/* replace termination null character with newline */
|
||||
*pos = '\n';
|
||||
*pos = '\n';
|
||||
pos++;
|
||||
len--;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user