]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TLS: Share digest OID checkers from X.509
authorJouni Malinen <j@w1.fi>
Thu, 17 Dec 2015 09:19:18 +0000 (11:19 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 17 Dec 2015 09:28:38 +0000 (11:28 +0200)
These will be used by the OCSP implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/tls/x509v3.c
src/tls/x509v3.h

index 9f39597994054e56622f486558a4113b71577172..c8085c904a2526ab9148436cbc97eed0a05fd91d 100644 (file)
@@ -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 */;
index 9cd904afacf2cf33a97bb307bd831b5b08b17734..3e97313f43f93739ee5f22a59b31d9811355e288 100644 (file)
@@ -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 */