From 932e3934bd58987c828aef400584aeb9d9d6068d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 3 Apr 2015 16:37:14 +0200 Subject: [PATCH] Fix typos & Co --- include/mbedtls/ecdsa.h | 16 ++++++++-------- include/mbedtls/md.h | 4 ++-- include/mbedtls/oid.h | 2 +- include/mbedtls/pkcs12.h | 4 ++-- include/mbedtls/pkcs5.h | 4 ++-- include/mbedtls/ssl.h | 4 ++-- include/mbedtls/x509_crt.h | 14 +++++++------- include/mbedtls/x509_csr.h | 6 +++--- library/ctr_drbg.c | 2 +- library/ssl_tls.c | 2 +- programs/pkey/dh_server.c | 2 +- programs/pkey/key_app_writer.c | 2 +- programs/x509/cert_req.c | 2 +- tests/suites/test_suite_x509parse.data | 4 ++-- tests/suites/test_suite_x509parse.function | 6 +++--- 15 files changed, 37 insertions(+), 37 deletions(-) diff --git a/include/mbedtls/ecdsa.h b/include/mbedtls/ecdsa.h index ae6c5266a..d22e24371 100644 --- a/include/mbedtls/ecdsa.h +++ b/include/mbedtls/ecdsa.h @@ -138,8 +138,8 @@ int ecdsa_verify( ecp_group *grp, * curve is used). POLARSSL_ECDSA_MAX_LEN is always safe. * * \return 0 if successful, - * or a POLARSSL_ERR_ECP, POLARSSL_ERR_MPI or - * POLARSSL_ERR_ASN1 error code + * or a POLARSSL_ERR_ECP_XXX, POLARSSL_ERR_MPI_XXX or + * POLARSSL_ERR_ASN1_XXX error code */ int ecdsa_write_signature( ecdsa_context *ctx, md_type_t md_alg, const unsigned char *hash, size_t hlen, @@ -174,8 +174,8 @@ int ecdsa_write_signature( ecdsa_context *ctx, md_type_t md_alg, * curve is used). POLARSSL_ECDSA_MAX_LEN is always safe. * * \return 0 if successful, - * or a POLARSSL_ERR_ECP, POLARSSL_ERR_MPI or - * POLARSSL_ERR_ASN1 error code + * or a POLARSSL_ERR_ECP_XXX, POLARSSL_ERR_MPI_XXX or + * POLARSSL_ERR_ASN1_XXX error code */ int ecdsa_write_signature_det( ecdsa_context *ctx, const unsigned char *hash, size_t hlen, @@ -196,9 +196,9 @@ int ecdsa_write_signature_det( ecdsa_context *ctx, * * \return 0 if successful, * POLARSSL_ERR_ECP_BAD_INPUT_DATA if signature is invalid, - * POLARSSL_ERR_ECP_SIG_LEN_MISTMATCH if the signature is + * POLARSSL_ERR_ECP_SIG_LEN_MISMATCH if the signature is * valid but its actual length is less than siglen, - * or a POLARSSL_ERR_ECP or POLARSSL_ERR_MPI error code + * or a POLARSSL_ERR_ECP_XXX or POLARSSL_ERR_MPI_XXX error code */ int ecdsa_read_signature( ecdsa_context *ctx, const unsigned char *hash, size_t hlen, @@ -213,7 +213,7 @@ int ecdsa_read_signature( ecdsa_context *ctx, * \param f_rng RNG function * \param p_rng RNG parameter * - * \return 0 on success, or a POLARSSL_ERR_ECP code. + * \return 0 on success, or a POLARSSL_ERR_ECP_XXX code. */ int ecdsa_genkey( ecdsa_context *ctx, ecp_group_id gid, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); @@ -224,7 +224,7 @@ int ecdsa_genkey( ecdsa_context *ctx, ecp_group_id gid, * \param ctx ECDSA context to set * \param key EC key to use * - * \return 0 on success, or a POLARSSL_ERR_ECP code. + * \return 0 on success, or a POLARSSL_ERR_ECP_XXX code. */ int ecdsa_from_keypair( ecdsa_context *ctx, const ecp_keypair *key ); diff --git a/include/mbedtls/md.h b/include/mbedtls/md.h index 0f1b6155f..74534f505 100644 --- a/include/mbedtls/md.h +++ b/include/mbedtls/md.h @@ -254,8 +254,8 @@ int md( const md_info_t *md_info, const unsigned char *input, size_t ilen, * \param path input file name * \param output generic message digest checksum result * - * \return 0 if successful, POLARSSL_ERR_MD_FILE_OPEN_FAILED if fopen - * failed, POLARSSL_ERR_MD_FILE_READ_FAILED if fread failed, + * \return 0 if successful, + * POLARSSL_ERR_MD_FILE_IO_ERROR if file input failed, * POLARSSL_ERR_MD_BAD_INPUT_DATA if md_info was NULL. */ int md_file( const md_info_t *md_info, const char *path, diff --git a/include/mbedtls/oid.h b/include/mbedtls/oid.h index 31a7d2be1..11330f251 100644 --- a/include/mbedtls/oid.h +++ b/include/mbedtls/oid.h @@ -396,7 +396,7 @@ typedef struct { * \param oid OID to translate * * \return Length of the string written (excluding final NULL) or - * POLARSSL_ERR_OID_BUF_TO_SMALL in case of error + * POLARSSL_ERR_OID_BUF_TOO_SMALL in case of error */ int oid_get_numeric_string( char *buf, size_t size, const asn1_buf *oid ); diff --git a/include/mbedtls/pkcs12.h b/include/mbedtls/pkcs12.h index cb53fe247..cc09aa53f 100644 --- a/include/mbedtls/pkcs12.h +++ b/include/mbedtls/pkcs12.h @@ -58,7 +58,7 @@ extern "C" { * \param len data length * \param output the output buffer * - * \return 0 if successful, or a POLARSSL_ERR_xxx code + * \return 0 if successful, or a POLARSSL_ERR_XXX code */ int pkcs12_pbe_sha1_rc4_128( asn1_buf *pbe_params, int mode, const unsigned char *pwd, size_t pwdlen, @@ -79,7 +79,7 @@ int pkcs12_pbe_sha1_rc4_128( asn1_buf *pbe_params, int mode, * \param len data length * \param output the output buffer * - * \return 0 if successful, or a POLARSSL_ERR_xxx code + * \return 0 if successful, or a POLARSSL_ERR_XXX code */ int pkcs12_pbe( asn1_buf *pbe_params, int mode, cipher_type_t cipher_type, md_type_t md_type, diff --git a/include/mbedtls/pkcs5.h b/include/mbedtls/pkcs5.h index 5a765e02b..f46be12bf 100644 --- a/include/mbedtls/pkcs5.h +++ b/include/mbedtls/pkcs5.h @@ -61,7 +61,7 @@ extern "C" { * \param datalen length of data * \param output output buffer * - * \returns 0 on success, or a POLARSSL_ERR_xxx code if verification fails. + * \returns 0 on success, or a POLARSSL_ERR_XXX code if verification fails. */ int pkcs5_pbes2( const asn1_buf *pbe_params, int mode, const unsigned char *pwd, size_t pwdlen, @@ -80,7 +80,7 @@ int pkcs5_pbes2( const asn1_buf *pbe_params, int mode, * \param key_length Length of generated key * \param output Generated key. Must be at least as big as key_length * - * \returns 0 on success, or a POLARSSL_ERR_xxx code if verification fails. + * \returns 0 on success, or a POLARSSL_ERR_XXX code if verification fails. */ int pkcs5_pbkdf2_hmac( md_context_t *ctx, const unsigned char *password, size_t plen, const unsigned char *salt, size_t slen, diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index 09aaf37d3..3fbb25e7c 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -2037,8 +2037,8 @@ const char *ssl_get_version( const ssl_context *ssl ); * \param ssl SSL context * * \return Current maximum record expansion in bytes, or - * POLARSSL_ERR_FEATURE_UNAVAILABLE if compression is enabled, - * which makes expansion much less predictable + * POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE if compression is + * enabled, which makes expansion much less predictable */ int ssl_get_record_expansion( const ssl_context *ssl ); diff --git a/include/mbedtls/x509_crt.h b/include/mbedtls/x509_crt.h index 7816801fe..021031b40 100644 --- a/include/mbedtls/x509_crt.h +++ b/include/mbedtls/x509_crt.h @@ -227,7 +227,7 @@ int x509_crt_info( char *buf, size_t size, const char *prefix, * \param f_vrfy verification function * \param p_vrfy verification parameter * - * \return 0 if successful or POLARSSL_ERR_X509_SIG_VERIFY_FAILED, + * \return 0 if successful or POLARSSL_ERR_X509_CERT_VERIFY_FAILED * in which case *flags will have one or more of * the following values set: * BADCERT_EXPIRED -- @@ -424,7 +424,7 @@ void x509write_crt_set_md_alg( x509write_cert *ctx, md_type_t md_alg ); * \param val value of the extension OCTET STRING * \param val_len length of the value data * - * \return 0 if successful, or a POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or a POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_crt_set_extension( x509write_cert *ctx, const char *oid, size_t oid_len, @@ -440,7 +440,7 @@ int x509write_crt_set_extension( x509write_cert *ctx, * certificate (only for CA certificates, -1 is * inlimited) * - * \return 0 if successful, or a POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or a POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_crt_set_basic_constraints( x509write_cert *ctx, int is_ca, int max_pathlen ); @@ -453,7 +453,7 @@ int x509write_crt_set_basic_constraints( x509write_cert *ctx, * * \param ctx CRT context to use * - * \return 0 if successful, or a POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or a POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_crt_set_subject_key_identifier( x509write_cert *ctx ); @@ -464,7 +464,7 @@ int x509write_crt_set_subject_key_identifier( x509write_cert *ctx ); * * \param ctx CRT context to use * - * \return 0 if successful, or a POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or a POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_crt_set_authority_key_identifier( x509write_cert *ctx ); #endif /* POLARSSL_SHA1_C */ @@ -476,7 +476,7 @@ int x509write_crt_set_authority_key_identifier( x509write_cert *ctx ); * \param ctx CRT context to use * \param key_usage key usage flags to set * - * \return 0 if successful, or POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_crt_set_key_usage( x509write_cert *ctx, unsigned char key_usage ); @@ -487,7 +487,7 @@ int x509write_crt_set_key_usage( x509write_cert *ctx, unsigned char key_usage ); * \param ctx CRT context to use * \param ns_cert_type Netscape Cert Type flags to set * - * \return 0 if successful, or POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_crt_set_ns_cert_type( x509write_cert *ctx, unsigned char ns_cert_type ); diff --git a/include/mbedtls/x509_csr.h b/include/mbedtls/x509_csr.h index 34f527b8e..69ff2cce0 100644 --- a/include/mbedtls/x509_csr.h +++ b/include/mbedtls/x509_csr.h @@ -197,7 +197,7 @@ void x509write_csr_set_md_alg( x509write_csr *ctx, md_type_t md_alg ); * \param ctx CSR context to use * \param key_usage key usage flags to set * - * \return 0 if successful, or POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_csr_set_key_usage( x509write_csr *ctx, unsigned char key_usage ); @@ -208,7 +208,7 @@ int x509write_csr_set_key_usage( x509write_csr *ctx, unsigned char key_usage ); * \param ctx CSR context to use * \param ns_cert_type Netscape Cert Type flags to set * - * \return 0 if successful, or POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_csr_set_ns_cert_type( x509write_csr *ctx, unsigned char ns_cert_type ); @@ -223,7 +223,7 @@ int x509write_csr_set_ns_cert_type( x509write_csr *ctx, * \param val value of the extension OCTET STRING * \param val_len length of the value data * - * \return 0 if successful, or a POLARSSL_ERR_X509WRITE_MALLOC_FAILED + * \return 0 if successful, or a POLARSSL_ERR_X509_MALLOC_FAILED */ int x509write_csr_set_extension( x509write_csr *ctx, const char *oid, size_t oid_len, diff --git a/library/ctr_drbg.c b/library/ctr_drbg.c index c3f4b382d..aee38335b 100644 --- a/library/ctr_drbg.c +++ b/library/ctr_drbg.c @@ -170,7 +170,7 @@ static int block_cipher_df( unsigned char *output, aes_setkey_enc( &aes_ctx, key, CTR_DRBG_KEYBITS ); /* - * Reduce data to POLARSSL_CTR_DRBG_SEEDLEN bytes of data + * Reduce data to CTR_DRBG_SEEDLEN bytes of data */ for( j = 0; j < CTR_DRBG_SEEDLEN; j += CTR_DRBG_BLOCKSIZE ) { diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 73aefc8dd..db11a8002 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -1098,7 +1098,7 @@ int ssl_psk_derive_premaster( ssl_context *ssl, key_exchange_type_t key_ex ) p += 48; } else -#endif /* POLARSSL_KEY_EXCHANGE_RSA_PKS_ENABLED */ +#endif /* POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED */ #if defined(POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED) if( key_ex == POLARSSL_KEY_EXCHANGE_DHE_PSK ) { diff --git a/programs/pkey/dh_server.c b/programs/pkey/dh_server.c index 524e8d6c6..3d5749544 100644 --- a/programs/pkey/dh_server.c +++ b/programs/pkey/dh_server.c @@ -61,7 +61,7 @@ int main( void ) polarssl_printf("POLARSSL_AES_C and/or POLARSSL_DHM_C and/or POLARSSL_ENTROPY_C " "and/or POLARSSL_NET_C and/or POLARSSL_RSA_C and/or " "POLARSSL_SHA256_C and/or POLARSSL_FS_IO and/or " - "POLARSSL_CTR_DBRG_C not defined.\n"); + "POLARSSL_CTR_DRBG_C not defined.\n"); return( 0 ); } #else diff --git a/programs/pkey/key_app_writer.c b/programs/pkey/key_app_writer.c index 1be0dd3a3..b0efa087e 100644 --- a/programs/pkey/key_app_writer.c +++ b/programs/pkey/key_app_writer.c @@ -404,4 +404,4 @@ exit: return( ret ); } -#endif /* POLARSSL_X509_WRITE_C && POLARSSL_FS_IO */ +#endif /* POLARSSL_PK_WRITE_C && POLARSSL_FS_IO */ diff --git a/programs/x509/cert_req.c b/programs/x509/cert_req.c index d1bc9767d..87e4e12d7 100644 --- a/programs/x509/cert_req.c +++ b/programs/x509/cert_req.c @@ -39,7 +39,7 @@ int main( void ) { polarssl_printf( "POLARSSL_X509_CSR_WRITE_C and/or POLARSSL_FS_IO and/or " - "POLARSSL_PK_PARSE_C and/or POLARSSL_SHA256_c and/or " + "POLARSSL_PK_PARSE_C and/or POLARSSL_SHA256_C and/or " "POLARSSL_ENTROPY_C and/or POLARSSL_CTR_DRBG_C " "not defined.\n"); return( 0 ); diff --git a/tests/suites/test_suite_x509parse.data b/tests/suites/test_suite_x509parse.data index 491f14ed6..8d5d42492 100644 --- a/tests/suites/test_suite_x509parse.data +++ b/tests/suites/test_suite_x509parse.data @@ -547,11 +547,11 @@ depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_ECDSA_C:POLARSSL_RSA_C:POLARSSL_ECP_DP_ x509_verify:"data_files/server8_int-ca2.crt":"data_files/test-ca.crt":"data_files/crl-ec-sha256.pem":"NULL":0:0:"NULL" X509 Certificate verification #50 (Valid, multiple CAs) -depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_RSA_C:POLARSSL_PKCS1_V15:POLARSSL_ECP_C:POLARSSL_ECP_DP_SECP383R1_ENABLED +depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_RSA_C:POLARSSL_PKCS1_V15:POLARSSL_ECP_C:POLARSSL_ECP_DP_SECP384R1_ENABLED x509_verify:"data_files/server2.crt":"data_files/test-ca_cat12.crt":"data_files/crl.pem":"NULL":0:0:"NULL" X509 Certificate verification #51 (Valid, multiple CAs, reverse order) -depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_RSA_C:POLARSSL_PKCS1_V15:POLARSSL_ECP_C:POLARSSL_ECP_DP_SECP383R1_ENABLED +depends_on:POLARSSL_PEM_PARSE_C:POLARSSL_RSA_C:POLARSSL_PKCS1_V15:POLARSSL_ECP_C:POLARSSL_ECP_DP_SECP384R1_ENABLED x509_verify:"data_files/server2.crt":"data_files/test-ca_cat21.crt":"data_files/crl.pem":"NULL":0:0:"NULL" X509 Certificate verification #52 (CA keyUsage valid) diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index fb5abe541..79b6a0af2 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -147,7 +147,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_CRT_C */ +/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_CRT_PARSE_C */ void x509_dn_gets( char *crt_file, char *entity, char *result_str ) { x509_crt crt; @@ -175,7 +175,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_CRT_C */ +/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_CRT_PARSE_C */ void x509_time_expired( char *crt_file, char *entity, int result ) { x509_crt crt; @@ -196,7 +196,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_CRT_C */ +/* BEGIN_CASE depends_on:POLARSSL_FS_IO:POLARSSL_X509_CRT_PARSE_C */ void x509_time_future( char *crt_file, char *entity, int result ) { x509_crt crt;