<commit_before>/*
 * ssl_utils.c
 *
 * Routines for interacting directly with SSL, X509 certificates, etc.
 */


#include "myproxy_common.h"	/* all needed headers included here */

#define PEM_CALLBACK(func)	func, NULL
#define PEM_NO_CALLBACK		NULL, NULL

/**********************************************************************
 *
 * Constants
 *
 */
#define PROXY_EXTENSION			"proxy"
#define LIMITED_PROXY_EXTENSION		"limited proxy"

#define PROXY_DEFAULT_LIFETIME		24 * 60 * 60 /* seconds */

/* Amount of clock skew to allow for when generating certificates */
#define PROXY_CLOCK_SKEW_ALLOWANCE	60 * 5 /* seconds */

#define PROXY_DEFAULT_VERSION		2L /* == v3 */

/* Return values for ssl_check_keys_match() */
#define SSL_KEYS_MATCH			1
#define SSL_KEYS_MISMATCH		-1

/**********************************************************************
 *
 * Internal data structures
 *
 */
struct _ssl_credentials<commit_msg>by default, delegate a proxy with maximum lifetime, instead of 24 hours<commit_after>/*
 * ssl_utils.c
 *
 * Routines for interacting directly with SSL, X509 certificates, etc.
 */


#include "myproxy_common.h"	/* all needed headers included here */

#define PEM_CALLBACK(func)	func, NULL
#define PEM_NO_CALLBACK		NULL, NULL

/**********************************************************************
 *
 * Constants
 *
 */
#define PROXY_EXTENSION			"proxy"
#define LIMITED_PROXY_EXTENSION		"limited proxy"

#define PROXY_DEFAULT_LIFETIME		-1L /* magic # for lifetime */
                                            /*   of signing cert    */

/* Amount of clock skew to allow for when generating certificates */
#define PROXY_CLOCK_SKEW_ALLOWANCE	60 * 5 /* seconds */

#define PROXY_DEFAULT_VERSION		2L /* == v3 */

/* Return values for ssl_check_keys_match() */
#define SSL_KEYS_MATCH			1
#define SSL_KEYS_MISMATCH		-1

/**********************************************************************
 *
 * Internal data structures
 *
 */
struct _ssl_credentials
{'fraction_non_alphanumeric': 0.2254951752158456, 'fraction_numerical': 0.014728288471305232, 'mean_word_length': 4.211640211640212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7406748', 'n_tokens_mistral': 630, 'n_tokens_neox': 590, 'n_words': 161}