Skip to content

Commit

Permalink
Merge pull request #544 from RUB-NDS/sidolfreiburgadjustments
Browse files Browse the repository at this point in the history
Sidolfreiburgadjustments
  • Loading branch information
ic0ns authored Feb 21, 2019
2 parents a549afd + 8f3edc0 commit 3c772c6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ private CertificateKeyType getPublicKeyType(Certificate cert) {
case "1.2.840.113549.1.1.1":
return CertificateKeyType.RSA;
case "1.2.840.10045.2.1":
case "1.2.840.10045.4.3.4":
return CertificateKeyType.ECDSA;
case "1.2.840.113549.1.3.1":
return CertificateKeyType.DH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public enum ClientCertificateType {
FORTEZZA_DMS_RESERVED((byte) 20),
GOSTR34101994((byte) 21),
GOSTR34102001((byte) 22),
ECDSA_SIGN((byte) 64), // TODO Implement these
RSA_FIXED_ECDH((byte) 65),
ECDSA_FIXED_ECDH((byte) 66),
GOST_SIGN256((byte) 66),
GOST_SIGN512((byte) 67),
GOSTR34102012_256((byte) 238),
GOSTR34102012_512((byte) 239);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ protected void parseHandshakeMessageContent(CertificateRequestMessage msg) {
LOGGER.debug("Parsing CertificateRequestMessage");
parseClientCertificateTypesCount(msg);
parseClientCertificateTypes(msg);
parseSignatureHashAlgorithmsLength(msg);
parseSignatureHashAlgorithms(msg);
if (getVersion() == ProtocolVersion.TLS12 || getVersion() == ProtocolVersion.DTLS12) {
parseSignatureHashAlgorithmsLength(msg);
parseSignatureHashAlgorithms(msg);
}
parseDistinguishedNamesLength(msg);
if (hasDistinguishedNamesLength(msg)) {
parseDistinguishedNames(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public CertificateVerifyParser(int pointer, byte[] array, ProtocolVersion versio
@Override
protected void parseHandshakeMessageContent(CertificateVerifyMessage msg) {
LOGGER.debug("Parsing CertificateVerifyMessage");
parseSignatureHashAlgorithm(msg);
if (getVersion() == ProtocolVersion.TLS12 || getVersion() == ProtocolVersion.DTLS12 || getVersion().isTLS13()) {
parseSignatureHashAlgorithm(msg);
}
parseSignatureLength(msg);
parseSignature(msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ public byte[] serializeHandshakeMessageContent() {
LOGGER.debug("Serializing CertificateRequestMessage");
writeClientCertificateTypesCount(msg);
writeClientCertificateTypes(msg);
writeSignatureHandshakeAlgorithmsLength(msg);
writeSignatureHandshakeAlgorithms(msg);
if (version == ProtocolVersion.TLS12 || version == ProtocolVersion.DTLS12) {
writeSignatureHandshakeAlgorithmsLength(msg);
writeSignatureHandshakeAlgorithms(msg);
}
writeDistinguishedNamesLength(msg);
if (hasDistinguishedNames(msg)) {
writeDistinguishedNames(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public CertificateVerifySerializer(CertificateVerifyMessage message, ProtocolVer
@Override
public byte[] serializeHandshakeMessageContent() {
LOGGER.debug("Serializing CertificateVerifyMessage");
writeSignatureHashAlgorithm(msg);
if (version == ProtocolVersion.TLS12 || version == ProtocolVersion.DTLS12 || version.isTLS13()) {
writeSignatureHashAlgorithm(msg);
}
writeSignatureLength(msg);
writeSignature(msg);
return getAlreadySerialized();
Expand Down

0 comments on commit 3c772c6

Please sign in to comment.