mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Document mutex usage for RSA
The mutex is now initialized iff ver != 0. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
		
							parent
							
								
									1226ecef01
								
							
						
					
					
						commit
						4337a9cb18
					
				@ -6,3 +6,8 @@ Bugfix
 | 
				
			|||||||
   * Fix a resource leak in a bad-arguments case of mbedtls_rsa_gen_key()
 | 
					   * Fix a resource leak in a bad-arguments case of mbedtls_rsa_gen_key()
 | 
				
			||||||
     when MBEDTLS_THREADING_C is enabled on platforms where initializing
 | 
					     when MBEDTLS_THREADING_C is enabled on platforms where initializing
 | 
				
			||||||
     a mutex allocates resources.
 | 
					     a mutex allocates resources.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Default behavior changes
 | 
				
			||||||
 | 
					   * In mbedtls_rsa_context objects, the ver field was formerly documented
 | 
				
			||||||
 | 
					     as always 0. It is now reserved for internal purposes and may take
 | 
				
			||||||
 | 
					     different values.
 | 
				
			||||||
 | 
				
			|||||||
@ -97,7 +97,10 @@ extern "C" {
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
typedef struct mbedtls_rsa_context
 | 
					typedef struct mbedtls_rsa_context
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int ver;                    /*!<  Always 0.*/
 | 
					    int ver;                    /*!<  Reserved for internal purposes.
 | 
				
			||||||
 | 
					                                 *    Do not set this field in application
 | 
				
			||||||
 | 
					                                 *    code. Its meaning might change without
 | 
				
			||||||
 | 
					                                 *    notice. */
 | 
				
			||||||
    size_t len;                 /*!<  The size of \p N in Bytes. */
 | 
					    size_t len;                 /*!<  The size of \p N in Bytes. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mbedtls_mpi N;              /*!<  The public modulus. */
 | 
					    mbedtls_mpi N;              /*!<  The public modulus. */
 | 
				
			||||||
@ -127,6 +130,7 @@ typedef struct mbedtls_rsa_context
 | 
				
			|||||||
                                     mask generating function used in the
 | 
					                                     mask generating function used in the
 | 
				
			||||||
                                     EME-OAEP and EMSA-PSS encodings. */
 | 
					                                     EME-OAEP and EMSA-PSS encodings. */
 | 
				
			||||||
#if defined(MBEDTLS_THREADING_C)
 | 
					#if defined(MBEDTLS_THREADING_C)
 | 
				
			||||||
 | 
					    /* Invariant: the mutex is initialized iff ver != 0. */
 | 
				
			||||||
    mbedtls_threading_mutex_t mutex;    /*!<  Thread-safety mutex. */
 | 
					    mbedtls_threading_mutex_t mutex;    /*!<  Thread-safety mutex. */
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user