diff options
author | tb <> | 2022-07-07 13:01:28 +0000 |
---|---|---|
committer | tb <> | 2022-07-07 13:01:28 +0000 |
commit | 144c180757b1433631a8e64a3dd86b9e3364d97c (patch) | |
tree | 539767872181d9087ed86b86848b9b25031ed468 /src | |
parent | 42eea85c684d57fd6947ac89719d3c7cb26cd34e (diff) | |
download | openbsd-144c180757b1433631a8e64a3dd86b9e3364d97c.tar.gz openbsd-144c180757b1433631a8e64a3dd86b9e3364d97c.tar.bz2 openbsd-144c180757b1433631a8e64a3dd86b9e3364d97c.zip |
Expose new API in headers.
These are mostly security-level related, but there are also ASN1_TIME
and ASN_INTEGER functions here, as well as some missing accessors.
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1.h | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/dsa/dsa.h | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/evp.h | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/rsa/rsa.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.h | 6 |
7 files changed, 7 insertions, 31 deletions
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index 3f9645a139..00634a6e82 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1.h,v 1.66 2022/07/04 14:39:43 tb Exp $ */ | 1 | /* $OpenBSD: asn1.h,v 1.67 2022/07/07 13:01:28 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -719,13 +719,11 @@ ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len); | |||
719 | int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out); | 719 | int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out); |
720 | extern const ASN1_ITEM ASN1_TIME_it; | 720 | extern const ASN1_ITEM ASN1_TIME_it; |
721 | 721 | ||
722 | #ifdef LIBRESSL_INTERNAL | ||
723 | int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm); | 722 | int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm); |
724 | int ASN1_TIME_compare(const ASN1_TIME *t1, const ASN1_TIME *t2); | 723 | int ASN1_TIME_compare(const ASN1_TIME *t1, const ASN1_TIME *t2); |
725 | int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t2); | 724 | int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t2); |
726 | int ASN1_TIME_normalize(ASN1_TIME *t); | 725 | int ASN1_TIME_normalize(ASN1_TIME *t); |
727 | int ASN1_TIME_set_string_X509(ASN1_TIME *time, const char *str); | 726 | int ASN1_TIME_set_string_X509(ASN1_TIME *time, const char *str); |
728 | #endif | ||
729 | int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, | 727 | int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, |
730 | const ASN1_TIME *to); | 728 | const ASN1_TIME *to); |
731 | 729 | ||
@@ -755,21 +753,17 @@ int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); | |||
755 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, | 753 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, |
756 | const char *sn, const char *ln); | 754 | const char *sn, const char *ln); |
757 | 755 | ||
758 | #ifdef LIBRESSL_INTERNAL | ||
759 | int ASN1_INTEGER_get_uint64(uint64_t *out_val, const ASN1_INTEGER *aint); | 756 | int ASN1_INTEGER_get_uint64(uint64_t *out_val, const ASN1_INTEGER *aint); |
760 | int ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val); | 757 | int ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val); |
761 | int ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint); | 758 | int ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint); |
762 | int ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val); | 759 | int ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val); |
763 | #endif | ||
764 | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); | 760 | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); |
765 | long ASN1_INTEGER_get(const ASN1_INTEGER *a); | 761 | long ASN1_INTEGER_get(const ASN1_INTEGER *a); |
766 | ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); | 762 | ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); |
767 | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); | 763 | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); |
768 | 764 | ||
769 | #ifdef LIBRESSL_INTERNAL | ||
770 | int ASN1_ENUMERATED_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum); | 765 | int ASN1_ENUMERATED_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum); |
771 | int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val); | 766 | int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val); |
772 | #endif | ||
773 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); | 767 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); |
774 | long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); | 768 | long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); |
775 | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); | 769 | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); |
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index 5abd489003..436be593bf 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn.h,v 1.53 2022/06/27 12:25:49 tb Exp $ */ | 1 | /* $OpenBSD: bn.h,v 1.54 2022/07/07 13:01:28 tb Exp $ */ |
2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -471,9 +471,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *ret, | |||
471 | 471 | ||
472 | void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); | 472 | void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); |
473 | 473 | ||
474 | #ifdef LIBRESSL_INTERNAL | ||
475 | int BN_security_bits(int L, int N); | 474 | int BN_security_bits(int L, int N); |
476 | #endif | ||
477 | 475 | ||
478 | /* Deprecated versions */ | 476 | /* Deprecated versions */ |
479 | #ifndef OPENSSL_NO_DEPRECATED | 477 | #ifndef OPENSSL_NO_DEPRECATED |
diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h index c7f4d3fdd0..4e4fdcd982 100644 --- a/src/lib/libcrypto/dh/dh.h +++ b/src/lib/libcrypto/dh/dh.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh.h,v 1.33 2022/06/27 12:31:38 tb Exp $ */ | 1 | /* $OpenBSD: dh.h,v 1.34 2022/07/07 13:01:28 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -143,9 +143,7 @@ int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | |||
143 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 143 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
144 | int DH_set_ex_data(DH *d, int idx, void *arg); | 144 | int DH_set_ex_data(DH *d, int idx, void *arg); |
145 | void *DH_get_ex_data(DH *d, int idx); | 145 | void *DH_get_ex_data(DH *d, int idx); |
146 | #ifdef LIBRESSL_INTERNAL | ||
147 | int DH_security_bits(const DH *dh); | 146 | int DH_security_bits(const DH *dh); |
148 | #endif | ||
149 | 147 | ||
150 | ENGINE *DH_get0_engine(DH *d); | 148 | ENGINE *DH_get0_engine(DH *d); |
151 | void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, | 149 | void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, |
diff --git a/src/lib/libcrypto/dsa/dsa.h b/src/lib/libcrypto/dsa/dsa.h index 12b1faadf3..75fb2d004b 100644 --- a/src/lib/libcrypto/dsa/dsa.h +++ b/src/lib/libcrypto/dsa/dsa.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa.h,v 1.37 2022/07/04 12:22:32 tb Exp $ */ | 1 | /* $OpenBSD: dsa.h,v 1.38 2022/07/07 13:01:28 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -151,9 +151,7 @@ int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | |||
151 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 151 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
152 | int DSA_set_ex_data(DSA *d, int idx, void *arg); | 152 | int DSA_set_ex_data(DSA *d, int idx, void *arg); |
153 | void *DSA_get_ex_data(DSA *d, int idx); | 153 | void *DSA_get_ex_data(DSA *d, int idx); |
154 | #ifdef LIBRESSL_INTERNAL | ||
155 | int DSA_security_bits(const DSA *d); | 154 | int DSA_security_bits(const DSA *d); |
156 | #endif | ||
157 | 155 | ||
158 | DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); | 156 | DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); |
159 | int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); | 157 | int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); |
@@ -222,10 +220,8 @@ ENGINE *DSA_get0_engine(DSA *d); | |||
222 | DSA_METHOD *DSA_meth_new(const char *name, int flags); | 220 | DSA_METHOD *DSA_meth_new(const char *name, int flags); |
223 | void DSA_meth_free(DSA_METHOD *meth); | 221 | void DSA_meth_free(DSA_METHOD *meth); |
224 | DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth); | 222 | DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth); |
225 | #ifdef LIBRESSL_INTERNAL | ||
226 | const char *DSA_meth_get0_name(const DSA_METHOD *meth); | 223 | const char *DSA_meth_get0_name(const DSA_METHOD *meth); |
227 | int DSA_meth_set1_name(DSA_METHOD *meth, const char *name); | 224 | int DSA_meth_set1_name(DSA_METHOD *meth, const char *name); |
228 | #endif | ||
229 | int DSA_meth_set_sign(DSA_METHOD *meth, | 225 | int DSA_meth_set_sign(DSA_METHOD *meth, |
230 | DSA_SIG *(*sign)(const unsigned char *, int, DSA *)); | 226 | DSA_SIG *(*sign)(const unsigned char *, int, DSA *)); |
231 | int DSA_meth_set_finish(DSA_METHOD *meth, int (*finish)(DSA *)); | 227 | int DSA_meth_set_finish(DSA_METHOD *meth, int (*finish)(DSA *)); |
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index a48b81c915..0574556b63 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp.h,v 1.101 2022/06/27 12:36:05 tb Exp $ */ | 1 | /* $OpenBSD: evp.h,v 1.102 2022/07/07 13:01:28 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -769,9 +769,7 @@ int EVP_PKEY_type(int type); | |||
769 | int EVP_PKEY_id(const EVP_PKEY *pkey); | 769 | int EVP_PKEY_id(const EVP_PKEY *pkey); |
770 | int EVP_PKEY_base_id(const EVP_PKEY *pkey); | 770 | int EVP_PKEY_base_id(const EVP_PKEY *pkey); |
771 | int EVP_PKEY_bits(const EVP_PKEY *pkey); | 771 | int EVP_PKEY_bits(const EVP_PKEY *pkey); |
772 | #ifdef LIBRESSL_INTERNAL | ||
773 | int EVP_PKEY_security_bits(const EVP_PKEY *pkey); | 772 | int EVP_PKEY_security_bits(const EVP_PKEY *pkey); |
774 | #endif | ||
775 | int EVP_PKEY_size(const EVP_PKEY *pkey); | 773 | int EVP_PKEY_size(const EVP_PKEY *pkey); |
776 | int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); | 774 | int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); |
777 | int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); | 775 | int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); |
@@ -934,10 +932,8 @@ void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, | |||
934 | void (*pkey_free)(EVP_PKEY *pkey)); | 932 | void (*pkey_free)(EVP_PKEY *pkey)); |
935 | void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, | 933 | void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, |
936 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2)); | 934 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2)); |
937 | #ifdef LIBRESSL_INTERNAL | ||
938 | void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, | 935 | void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, |
939 | int (*pkey_security_bits)(const EVP_PKEY *pkey)); | 936 | int (*pkey_security_bits)(const EVP_PKEY *pkey)); |
940 | #endif | ||
941 | 937 | ||
942 | void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, | 938 | void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, |
943 | int (*pkey_check)(const EVP_PKEY *pk)); | 939 | int (*pkey_check)(const EVP_PKEY *pk)); |
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h index 8e19da2c7f..888902d18c 100644 --- a/src/lib/libcrypto/rsa/rsa.h +++ b/src/lib/libcrypto/rsa/rsa.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa.h,v 1.56 2022/06/27 12:30:28 tb Exp $ */ | 1 | /* $OpenBSD: rsa.h,v 1.57 2022/07/07 13:01:28 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -372,9 +372,7 @@ int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | |||
372 | int RSA_set_ex_data(RSA *r, int idx, void *arg); | 372 | int RSA_set_ex_data(RSA *r, int idx, void *arg); |
373 | void *RSA_get_ex_data(const RSA *r, int idx); | 373 | void *RSA_get_ex_data(const RSA *r, int idx); |
374 | 374 | ||
375 | #ifdef LIBRESSL_INTERNAL | ||
376 | int RSA_security_bits(const RSA *rsa); | 375 | int RSA_security_bits(const RSA *rsa); |
377 | #endif | ||
378 | 376 | ||
379 | void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, | 377 | void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, |
380 | const BIGNUM **d); | 378 | const BIGNUM **d); |
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h index b18dd02fc0..98b1cf5e92 100644 --- a/src/lib/libcrypto/x509/x509_vfy.h +++ b/src/lib/libcrypto/x509/x509_vfy.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vfy.h,v 1.53 2022/07/04 12:17:32 tb Exp $ */ | 1 | /* $OpenBSD: x509_vfy.h,v 1.54 2022/07/07 13:01:28 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -205,12 +205,10 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); | |||
205 | /* Issuer lookup error */ | 205 | /* Issuer lookup error */ |
206 | #define X509_V_ERR_STORE_LOOKUP 66 | 206 | #define X509_V_ERR_STORE_LOOKUP 66 |
207 | 207 | ||
208 | #if defined(LIBRESSL_INTERNAL) | ||
209 | /* Security level errors */ | 208 | /* Security level errors */ |
210 | #define X509_V_ERR_EE_KEY_TOO_SMALL 67 | 209 | #define X509_V_ERR_EE_KEY_TOO_SMALL 67 |
211 | #define X509_V_ERR_CA_KEY_TOO_SMALL 68 | 210 | #define X509_V_ERR_CA_KEY_TOO_SMALL 68 |
212 | #define X509_V_ERR_CA_MD_TOO_WEAK 69 | 211 | #define X509_V_ERR_CA_MD_TOO_WEAK 69 |
213 | #endif | ||
214 | 212 | ||
215 | /* Certificate verify flags */ | 213 | /* Certificate verify flags */ |
216 | 214 | ||
@@ -433,10 +431,8 @@ unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param); | |||
433 | int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); | 431 | int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); |
434 | int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); | 432 | int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); |
435 | void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); | 433 | void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); |
436 | #if defined(LIBRESSL_INTERNAL) | ||
437 | void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); | 434 | void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); |
438 | time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); | 435 | time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); |
439 | #endif | ||
440 | void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); | 436 | void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); |
441 | int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, | 437 | int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, |
442 | ASN1_OBJECT *policy); | 438 | ASN1_OBJECT *policy); |