aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-12-17 09:19:18 (GMT)
committerJouni Malinen <j@w1.fi>2015-12-17 09:28:38 (GMT)
commit32ce69092e03f59229dec1bcc32c2cd591982f78 (patch)
treed458558d1ca8445ac9773d7b040a67be06973cbc /src/tls
parentb72a36718f1ddf47ea9116d2c3edcf4b0ffb0d5b (diff)
downloadhostap-32ce69092e03f59229dec1bcc32c2cd591982f78.zip
hostap-32ce69092e03f59229dec1bcc32c2cd591982f78.tar.gz
hostap-32ce69092e03f59229dec1bcc32c2cd591982f78.tar.bz2
TLS: Share digest OID checkers from X.509
These will be used by the OCSP implementation. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/tls')
-rw-r--r--src/tls/x509v3.c8
-rw-r--r--src/tls/x509v3.h5
2 files changed, 9 insertions, 4 deletions
diff --git a/src/tls/x509v3.c b/src/tls/x509v3.c
index 9f39597..c8085c9 100644
--- a/src/tls/x509v3.c
+++ b/src/tls/x509v3.c
@@ -1553,7 +1553,7 @@ static int x509_digest_oid(struct asn1_oid *oid)
}
-static int x509_sha1_oid(struct asn1_oid *oid)
+int x509_sha1_oid(struct asn1_oid *oid)
{
return oid->len == 6 &&
oid->oid[0] == 1 /* iso */ &&
@@ -1579,21 +1579,21 @@ static int x509_sha2_oid(struct asn1_oid *oid)
}
-static int x509_sha256_oid(struct asn1_oid *oid)
+int x509_sha256_oid(struct asn1_oid *oid)
{
return x509_sha2_oid(oid) &&
oid->oid[8] == 1 /* sha256 */;
}
-static int x509_sha384_oid(struct asn1_oid *oid)
+int x509_sha384_oid(struct asn1_oid *oid)
{
return x509_sha2_oid(oid) &&
oid->oid[8] == 2 /* sha384 */;
}
-static int x509_sha512_oid(struct asn1_oid *oid)
+int x509_sha512_oid(struct asn1_oid *oid)
{
return x509_sha2_oid(oid) &&
oid->oid[8] == 3 /* sha512 */;
diff --git a/src/tls/x509v3.h b/src/tls/x509v3.h
index 9cd904a..3e97313 100644
--- a/src/tls/x509v3.h
+++ b/src/tls/x509v3.h
@@ -142,4 +142,9 @@ x509_certificate_get_subject(struct x509_certificate *chain,
struct x509_name *name);
int x509_certificate_self_signed(struct x509_certificate *cert);
+int x509_sha1_oid(struct asn1_oid *oid);
+int x509_sha256_oid(struct asn1_oid *oid);
+int x509_sha384_oid(struct asn1_oid *oid);
+int x509_sha512_oid(struct asn1_oid *oid);
+
#endif /* X509V3_H */