summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-07-07 13:01:28 +0000
committertb <>2022-07-07 13:01:28 +0000
commit144c180757b1433631a8e64a3dd86b9e3364d97c (patch)
tree539767872181d9087ed86b86848b9b25031ed468 /src
parent42eea85c684d57fd6947ac89719d3c7cb26cd34e (diff)
downloadopenbsd-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.h8
-rw-r--r--src/lib/libcrypto/bn/bn.h4
-rw-r--r--src/lib/libcrypto/dh/dh.h4
-rw-r--r--src/lib/libcrypto/dsa/dsa.h6
-rw-r--r--src/lib/libcrypto/evp/evp.h6
-rw-r--r--src/lib/libcrypto/rsa/rsa.h4
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.h6
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);
719int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out); 719int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out);
720extern const ASN1_ITEM ASN1_TIME_it; 720extern const ASN1_ITEM ASN1_TIME_it;
721 721
722#ifdef LIBRESSL_INTERNAL
723int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm); 722int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm);
724int ASN1_TIME_compare(const ASN1_TIME *t1, const ASN1_TIME *t2); 723int ASN1_TIME_compare(const ASN1_TIME *t1, const ASN1_TIME *t2);
725int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t2); 724int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t2);
726int ASN1_TIME_normalize(ASN1_TIME *t); 725int ASN1_TIME_normalize(ASN1_TIME *t);
727int ASN1_TIME_set_string_X509(ASN1_TIME *time, const char *str); 726int ASN1_TIME_set_string_X509(ASN1_TIME *time, const char *str);
728#endif
729int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, 727int 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);
755ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, 753ASN1_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
759int ASN1_INTEGER_get_uint64(uint64_t *out_val, const ASN1_INTEGER *aint); 756int ASN1_INTEGER_get_uint64(uint64_t *out_val, const ASN1_INTEGER *aint);
760int ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val); 757int ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val);
761int ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint); 758int ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint);
762int ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val); 759int ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val);
763#endif
764int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); 760int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
765long ASN1_INTEGER_get(const ASN1_INTEGER *a); 761long ASN1_INTEGER_get(const ASN1_INTEGER *a);
766ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); 762ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
767BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); 763BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
768 764
769#ifdef LIBRESSL_INTERNAL
770int ASN1_ENUMERATED_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum); 765int ASN1_ENUMERATED_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum);
771int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val); 766int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val);
772#endif
773int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); 767int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
774long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); 768long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
775ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); 769ASN1_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
472void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); 472void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
473 473
474#ifdef LIBRESSL_INTERNAL
475int BN_security_bits(int L, int N); 474int 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);
144int DH_set_ex_data(DH *d, int idx, void *arg); 144int DH_set_ex_data(DH *d, int idx, void *arg);
145void *DH_get_ex_data(DH *d, int idx); 145void *DH_get_ex_data(DH *d, int idx);
146#ifdef LIBRESSL_INTERNAL
147int DH_security_bits(const DH *dh); 146int DH_security_bits(const DH *dh);
148#endif
149 147
150ENGINE *DH_get0_engine(DH *d); 148ENGINE *DH_get0_engine(DH *d);
151void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, 149void 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);
152int DSA_set_ex_data(DSA *d, int idx, void *arg); 152int DSA_set_ex_data(DSA *d, int idx, void *arg);
153void *DSA_get_ex_data(DSA *d, int idx); 153void *DSA_get_ex_data(DSA *d, int idx);
154#ifdef LIBRESSL_INTERNAL
155int DSA_security_bits(const DSA *d); 154int DSA_security_bits(const DSA *d);
156#endif
157 155
158DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); 156DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
159int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); 157int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
@@ -222,10 +220,8 @@ ENGINE *DSA_get0_engine(DSA *d);
222DSA_METHOD *DSA_meth_new(const char *name, int flags); 220DSA_METHOD *DSA_meth_new(const char *name, int flags);
223void DSA_meth_free(DSA_METHOD *meth); 221void DSA_meth_free(DSA_METHOD *meth);
224DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth); 222DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth);
225#ifdef LIBRESSL_INTERNAL
226const char *DSA_meth_get0_name(const DSA_METHOD *meth); 223const char *DSA_meth_get0_name(const DSA_METHOD *meth);
227int DSA_meth_set1_name(DSA_METHOD *meth, const char *name); 224int DSA_meth_set1_name(DSA_METHOD *meth, const char *name);
228#endif
229int DSA_meth_set_sign(DSA_METHOD *meth, 225int 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 *));
231int DSA_meth_set_finish(DSA_METHOD *meth, int (*finish)(DSA *)); 227int 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);
769int EVP_PKEY_id(const EVP_PKEY *pkey); 769int EVP_PKEY_id(const EVP_PKEY *pkey);
770int EVP_PKEY_base_id(const EVP_PKEY *pkey); 770int EVP_PKEY_base_id(const EVP_PKEY *pkey);
771int EVP_PKEY_bits(const EVP_PKEY *pkey); 771int EVP_PKEY_bits(const EVP_PKEY *pkey);
772#ifdef LIBRESSL_INTERNAL
773int EVP_PKEY_security_bits(const EVP_PKEY *pkey); 772int EVP_PKEY_security_bits(const EVP_PKEY *pkey);
774#endif
775int EVP_PKEY_size(const EVP_PKEY *pkey); 773int EVP_PKEY_size(const EVP_PKEY *pkey);
776int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); 774int EVP_PKEY_set_type(EVP_PKEY *pkey, int type);
777int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); 775int 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));
935void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, 933void 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
938void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, 935void 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
942void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, 938void 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,
372int RSA_set_ex_data(RSA *r, int idx, void *arg); 372int RSA_set_ex_data(RSA *r, int idx, void *arg);
373void *RSA_get_ex_data(const RSA *r, int idx); 373void *RSA_get_ex_data(const RSA *r, int idx);
374 374
375#ifdef LIBRESSL_INTERNAL
376int RSA_security_bits(const RSA *rsa); 375int RSA_security_bits(const RSA *rsa);
377#endif
378 376
379void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, 377void 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);
433int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); 431int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
434int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); 432int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
435void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); 433void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
436#if defined(LIBRESSL_INTERNAL)
437void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); 434void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level);
438time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); 435time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param);
439#endif
440void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); 436void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
441int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, 437int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
442 ASN1_OBJECT *policy); 438 ASN1_OBJECT *policy);