Changeset 105945 in vbox for trunk/src/libs/openssl-3.1.7/crypto/dsa/dsa_check.c
- Timestamp:
- Sep 4, 2024 11:32:47 AM (6 months ago)
- svn:sync-xref-src-repo-rev:
- 164679
- Location:
- trunk/src/libs/openssl-3.1.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/openssl-3.1.7
- Property svn:mergeinfo
-
old new 25 25 /vendor/openssl/3.0.3:151497-151729 26 26 /vendor/openssl/3.0.7:154371 27 /vendor/openssl/3.1.7:164675-164677
-
- Property svn:mergeinfo
-
trunk/src/libs/openssl-3.1.7/crypto/dsa/dsa_check.c
r104078 r105945 1 1 /* 2 * Copyright 1995-202 3The OpenSSL Project Authors. All Rights Reserved.2 * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. 3 3 * 4 4 * Licensed under the Apache License 2.0 (the "License"). You may not use … … 20 20 #include "crypto/dsa.h" 21 21 22 static int dsa_precheck_params(const DSA *dsa, int *ret) 23 { 24 if (dsa->params.p == NULL || dsa->params.q == NULL) { 25 ERR_raise(ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS); 26 *ret = FFC_CHECK_INVALID_PQ; 27 return 0; 28 } 29 30 if (BN_num_bits(dsa->params.p) > OPENSSL_DSA_MAX_MODULUS_BITS) { 31 ERR_raise(ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE); 32 *ret = FFC_CHECK_INVALID_PQ; 33 return 0; 34 } 35 36 if (BN_num_bits(dsa->params.q) >= BN_num_bits(dsa->params.p)) { 37 ERR_raise(ERR_LIB_DSA, DSA_R_BAD_Q_VALUE); 38 *ret = FFC_CHECK_INVALID_PQ; 39 return 0; 40 } 41 42 return 1; 43 } 44 22 45 int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret) 23 46 { 47 if (!dsa_precheck_params(dsa, ret)) 48 return 0; 49 24 50 if (checktype == OSSL_KEYMGMT_VALIDATE_QUICK_CHECK) 25 51 return ossl_ffc_params_simple_validate(dsa->libctx, &dsa->params, … … 40 66 int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) 41 67 { 68 if (!dsa_precheck_params(dsa, ret)) 69 return 0; 70 42 71 return ossl_ffc_validate_public_key(&dsa->params, pub_key, ret) 43 72 && *ret == 0; … … 51 80 int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, int *ret) 52 81 { 82 if (!dsa_precheck_params(dsa, ret)) 83 return 0; 84 53 85 return ossl_ffc_validate_public_key_partial(&dsa->params, pub_key, ret) 54 86 && *ret == 0; … … 59 91 *ret = 0; 60 92 61 return (dsa->params.q != NULL 62 && ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret)); 93 if (!dsa_precheck_params(dsa, ret)) 94 return 0; 95 96 return ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret); 63 97 } 64 98 … … 73 107 BIGNUM *pub_key = NULL; 74 108 75 if (dsa->params.p == NULL 76 || dsa->params.g == NULL 109 if (!dsa_precheck_params(dsa, &ret)) 110 return 0; 111 112 if (dsa->params.g == NULL 77 113 || dsa->priv_key == NULL 78 114 || dsa->pub_key == NULL)
Note:
See TracChangeset
for help on using the changeset viewer.