typedef enum { GNUTLS_CRD_CERTIFICATE=1, GNUTLS_CRD_ANON, GNUTLS_CRD_SRP } gnutls_credentials_type_t;
+#define GNUTLS_MAC_SHA GNUTLS_MAC_SHA1
+#define GNUTLS_DIG_SHA GNUTLS_DIG_SHA1
typedef enum { GNUTLS_MAC_NULL=1,
- GNUTLS_MAC_MD5, GNUTLS_MAC_SHA, GNUTLS_MAC_RMD160
+ GNUTLS_MAC_MD5, GNUTLS_MAC_SHA1, GNUTLS_MAC_RMD160
} gnutls_mac_algorithm_t;
/* The enumerations here should have the same value with gnutls_mac_algorithm_t.
*/
typedef enum { GNUTLS_DIG_NULL=1, GNUTLS_DIG_MD5,
- GNUTLS_DIG_SHA, GNUTLS_DIG_RMD160
+ GNUTLS_DIG_SHA1, GNUTLS_DIG_RMD160
} gnutls_digest_algorithm_t;
/* exported for other gnutls headers. This is the maximum number
const char *gnutls_pk_algorithm_get_name( gnutls_pk_algorithm_t algorithm);
-typedef enum { GNUTLS_SIGN_UNKNOWN=0, GNUTLS_SIGN_RSA_SHA = 1, GNUTLS_SIGN_DSA_SHA,
+#define GNUTLS_SIGN_RSA_SHA GNUTLS_SIGN_RSA_SHA1
+#define GNUTLS_SIGN_DSA_SHA GNUTLS_SIGN_DSA_SHA1
+typedef enum { GNUTLS_SIGN_UNKNOWN=0, GNUTLS_SIGN_RSA_SHA1 = 1, GNUTLS_SIGN_DSA_SHA1,
GNUTLS_SIGN_RSA_MD5, GNUTLS_SIGN_RSA_MD2, GNUTLS_SIGN_RSA_RMD160
} gnutls_sign_algorithm_t;
typedef struct gnutls_hash_entry gnutls_hash_entry;
static const gnutls_hash_entry hash_algorithms[] = {
- {"SHA", OID_SHA1, GNUTLS_MAC_SHA},
+ {"SHA", OID_SHA1, GNUTLS_MAC_SHA1},
{"MD5", OID_MD5, GNUTLS_MAC_MD5},
{"MD2", OID_MD2, 0/*GNUTLS_MAC_MD2*/},
{"RIPEMD160", OID_RMD160, GNUTLS_MAC_RMD160},
/* ANONymous cipher suites.
*/
-#define GNUTLS_ANON_DH_3DES_EDE_CBC_SHA { 0x00, 0x1B }
+#define GNUTLS_ANON_DH_3DES_EDE_CBC_SHA1 { 0x00, 0x1B }
#define GNUTLS_ANON_DH_ARCFOUR_MD5 { 0x00, 0x18 }
/* rfc3268: */
-#define GNUTLS_ANON_DH_AES_128_CBC_SHA { 0x00, 0x34 }
-#define GNUTLS_ANON_DH_AES_256_CBC_SHA { 0x00, 0x3A }
+#define GNUTLS_ANON_DH_AES_128_CBC_SHA1 { 0x00, 0x34 }
+#define GNUTLS_ANON_DH_AES_256_CBC_SHA1 { 0x00, 0x3A }
/* SRP (not in TLS 1.0)
* draft-ietf-tls-srp-02:
*/
-#define GNUTLS_SRP_SHA_3DES_EDE_CBC_SHA { 0x00, 0x50 }
-#define GNUTLS_SRP_SHA_AES_128_CBC_SHA { 0x00, 0x53 }
-#define GNUTLS_SRP_SHA_AES_256_CBC_SHA { 0x00, 0x56 }
+#define GNUTLS_SRP_SHA_3DES_EDE_CBC_SHA1 { 0x00, 0x50 }
+#define GNUTLS_SRP_SHA_AES_128_CBC_SHA1 { 0x00, 0x53 }
+#define GNUTLS_SRP_SHA_AES_256_CBC_SHA1 { 0x00, 0x56 }
-#define GNUTLS_SRP_SHA_RSA_3DES_EDE_CBC_SHA { 0x00, 0x51 }
-#define GNUTLS_SRP_SHA_DSS_3DES_EDE_CBC_SHA { 0x00, 0x52 }
+#define GNUTLS_SRP_SHA_RSA_3DES_EDE_CBC_SHA1 { 0x00, 0x51 }
+#define GNUTLS_SRP_SHA_DSS_3DES_EDE_CBC_SHA1 { 0x00, 0x52 }
-#define GNUTLS_SRP_SHA_RSA_AES_128_CBC_SHA { 0x00, 0x54 }
-#define GNUTLS_SRP_SHA_DSS_AES_128_CBC_SHA { 0x00, 0x55 }
+#define GNUTLS_SRP_SHA_RSA_AES_128_CBC_SHA1 { 0x00, 0x54 }
+#define GNUTLS_SRP_SHA_DSS_AES_128_CBC_SHA1 { 0x00, 0x55 }
-#define GNUTLS_SRP_SHA_RSA_AES_256_CBC_SHA { 0x00, 0x57 }
-#define GNUTLS_SRP_SHA_DSS_AES_256_CBC_SHA { 0x00, 0x58 }
+#define GNUTLS_SRP_SHA_RSA_AES_256_CBC_SHA1 { 0x00, 0x57 }
+#define GNUTLS_SRP_SHA_DSS_AES_256_CBC_SHA1 { 0x00, 0x58 }
/* RSA
*/
-#define GNUTLS_RSA_ARCFOUR_SHA { 0x00, 0x05 }
+#define GNUTLS_RSA_ARCFOUR_SHA1 { 0x00, 0x05 }
#define GNUTLS_RSA_ARCFOUR_MD5 { 0x00, 0x04 }
-#define GNUTLS_RSA_3DES_EDE_CBC_SHA { 0x00, 0x0A }
+#define GNUTLS_RSA_3DES_EDE_CBC_SHA1 { 0x00, 0x0A }
#define GNUTLS_RSA_EXPORT_ARCFOUR_40_MD5 { 0x00, 0x03 }
/* rfc3268:
*/
-#define GNUTLS_RSA_AES_128_CBC_SHA { 0x00, 0x2F }
-#define GNUTLS_RSA_AES_256_CBC_SHA { 0x00, 0x35 }
+#define GNUTLS_RSA_AES_128_CBC_SHA1 { 0x00, 0x2F }
+#define GNUTLS_RSA_AES_256_CBC_SHA1 { 0x00, 0x35 }
/* DHE DSS
*/
-#define GNUTLS_DHE_DSS_3DES_EDE_CBC_SHA { 0x00, 0x13 }
+#define GNUTLS_DHE_DSS_3DES_EDE_CBC_SHA1 { 0x00, 0x13 }
/* draft-ietf-tls-openpgp-keys-04:
/* draft-ietf-tls-56-bit-ciphersuites-01:
*/
-#define GNUTLS_DHE_DSS_ARCFOUR_SHA { 0x00, 0x66 }
+#define GNUTLS_DHE_DSS_ARCFOUR_SHA1 { 0x00, 0x66 }
/* rfc3268:
*/
-#define GNUTLS_DHE_DSS_AES_256_CBC_SHA { 0x00, 0x38 }
-#define GNUTLS_DHE_DSS_AES_128_CBC_SHA { 0x00, 0x32 }
+#define GNUTLS_DHE_DSS_AES_256_CBC_SHA1 { 0x00, 0x38 }
+#define GNUTLS_DHE_DSS_AES_128_CBC_SHA1 { 0x00, 0x32 }
/* DHE RSA
*/
-#define GNUTLS_DHE_RSA_3DES_EDE_CBC_SHA { 0x00, 0x16 }
+#define GNUTLS_DHE_RSA_3DES_EDE_CBC_SHA1 { 0x00, 0x16 }
/* rfc3268:
*/
-#define GNUTLS_DHE_RSA_AES_128_CBC_SHA { 0x00, 0x33 }
-#define GNUTLS_DHE_RSA_AES_256_CBC_SHA { 0x00, 0x39 }
+#define GNUTLS_DHE_RSA_AES_128_CBC_SHA1 { 0x00, 0x33 }
+#define GNUTLS_DHE_RSA_AES_256_CBC_SHA1 { 0x00, 0x39 }
#define CIPHER_SUITES_COUNT sizeof(cs_algorithms)/sizeof(gnutls_cipher_suite_entry)-1
GNUTLS_CIPHER_ARCFOUR_128,
GNUTLS_KX_ANON_DH, GNUTLS_MAC_MD5,
GNUTLS_SSL3),
- GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_ANON_DH_3DES_EDE_CBC_SHA,
+ GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_ANON_DH_3DES_EDE_CBC_SHA1,
GNUTLS_CIPHER_3DES_CBC, GNUTLS_KX_ANON_DH,
- GNUTLS_MAC_SHA, GNUTLS_SSL3),
- GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_ANON_DH_AES_128_CBC_SHA,
+ GNUTLS_MAC_SHA1, GNUTLS_SSL3),
+ GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_ANON_DH_AES_128_CBC_SHA1,
GNUTLS_CIPHER_AES_128_CBC, GNUTLS_KX_ANON_DH,
- GNUTLS_MAC_SHA, GNUTLS_SSL3),
- GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_ANON_DH_AES_256_CBC_SHA,
+ GNUTLS_MAC_SHA1, GNUTLS_SSL3),
+ GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_ANON_DH_AES_256_CBC_SHA1,
GNUTLS_CIPHER_AES_256_CBC, GNUTLS_KX_ANON_DH,
- G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S_SSL3),
GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_RSA_ARCFOUR_MD5,
GNUTLS_CIPHER_ARCFOUR_128,
GNUTLS_KX_RSA, GNUTLS_MAC_MD5, GNUTLS_SSL3),
- GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_RSA_3DES_EDE_CBC_SHA,
+ GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_RSA_3DES_EDE_CBC_SHA1,
GNUTLS_CIPHER_3DES_CBC,
- GNUTLS_KX_RSA, GNUTLS_MAC_SHA, GNUTLS_SSL3),
- GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_RSA_AES_128_CBC_SHA,
+ GNUTLS_KX_RSA, GNUTLS_MAC_SHA1, GNUTLS_SSL3),
+ GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_RSA_AES_128_CBC_SHA1,
GNUTLS_CIPHER_AES_128_CBC, GNUTLS_KX_RSA,
- GNUTLS_MAC_SHA, GNUTLS_SSL3),
- GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_RSA_AES_256_CBC_SHA,
+ GNUTLS_MAC_SHA1, GNUTLS_SSL3),
+ GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_RSA_AES_256_CBC_SHA1,
GNUTLS_CIPHER_AES_256_CBC, GNUTLS_KX_RSA,
- GNUTLS_MAC_SHA, GNUTLS_SSL3),
+ GNUTLS_MAC_SHA1, GNUTLS_SSL3),
GNUTLS_CIPHER_SUITE_ENTRY(GNUTLS_RSA_3DES_EDE_CBC_RMD,
GNUTLS_CIPHER_3DES_CBC,
GNUTLS_KX_RSA, GNUTLS_MAC_RMD160,
typedef struct gnutls_sign_entry gnutls_sign_entry;
static const gnutls_sign_entry sign_algorithms[] = {
- {"RSA-SHA", RSA_SHA1_OID, GNUTLS_SIGN_RSA_SHA, GNUTLS_PK_RSA, GNUTLS_MAC_SHA},
+ {"RSA-SHA", RSA_SHA1_OID, GNUTLS_SIGN_RSA_SHA1, GNUTLS_PK_RSA, GNUTLS_MAC_SHA1},
{"RSA-RMD160", RSA_RMD160_OID, GNUTLS_SIGN_RSA_RMD160, GNUTLS_PK_RSA, GNUTLS_MAC_RMD160},
- {"DSA-SHA", DSA_SHA1_OID, GNUTLS_SIGN_DSA_SHA, GNUTLS_PK_DSA, GNUTLS_MAC_SHA},
+ {"DSA-SHA", DSA_SHA1_OID, GNUTLS_SIGN_DSA_SHA1, GNUTLS_PK_DSA, GNUTLS_MAC_SHA1},
{"RSA-MD5", RSA_MD5_OID, GNUTLS_SIGN_RSA_MD5, GNUTLS_PK_RSA, GNUTLS_MAC_MD5},
{"RSA-MD2", RSA_MD2_OID, GNUTLS_SIGN_RSA_MD2, GNUTLS_PK_RSA, 0/*GNUTLS_MAC_MD2*/},
{0, 0, 0, 0, 0}
if (session->internals.handshake_mac_handle_sha == NULL) {
session->internals.handshake_mac_handle_sha =
- _gnutls_hash_init(GNUTLS_MAC_SHA);
+ _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (session->internals.handshake_mac_handle_sha ==
GNUTLS_HASH_FAILED) {
gnutls_assert();
ret->algorithm = algorithm;
switch (algorithm) {
- case GNUTLS_MAC_SHA:
+ case GNUTLS_MAC_SHA1:
result = gc_hash_open(GC_SHA1, 0, &ret->handle);
break;
case GNUTLS_MAC_MD5:
int ret;
switch (algorithm) {
- case GNUTLS_MAC_SHA:
+ case GNUTLS_MAC_SHA1:
ret = gc_hash_digest_length(GC_SHA1);
break;
case GNUTLS_MAC_MD5:
return GNUTLS_MAC_FAILED;
switch (algorithm) {
- case GNUTLS_MAC_SHA:
+ case GNUTLS_MAC_SHA1:
result = gc_hash_open(GC_SHA1, GC_HMAC, &ret->handle);
break;
case GNUTLS_MAC_MD5:
switch (algorithm) {
case GNUTLS_MAC_MD5:
return 48;
- case GNUTLS_MAC_SHA:
+ case GNUTLS_MAC_SHA1:
return 40;
default:
return 0;
text1[j] = 65 + i; /* A==65 */
}
- td = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ td = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (td == NULL) {
gnutls_assert();
return GNUTLS_E_HASH_FAILED;
return ret;
}
- _gnutls_hash(td, tmp, _gnutls_hash_get_algo_len(GNUTLS_MAC_SHA));
+ _gnutls_hash(td, tmp, _gnutls_hash_get_algo_len(GNUTLS_MAC_SHA1));
_gnutls_hash_deinit(td, digest);
return 0;
} gnutls_params_type_t;
typedef enum gnutls_mac_algorithm { GNUTLS_MAC_UNKNOWN = 0,
- GNUTLS_MAC_NULL = 1, GNUTLS_MAC_MD5, GNUTLS_MAC_SHA,
+ GNUTLS_MAC_NULL = 1, GNUTLS_MAC_MD5, GNUTLS_MAC_SHA1,
GNUTLS_MAC_RMD160
} gnutls_mac_algorithm_t;
typedef gnutls_mac_algorithm_t gnutls_digest_algorithm_t;
typedef enum gnutls_sign_algorithm {
GNUTLS_SIGN_UNKNOWN = 0,
- GNUTLS_SIGN_RSA_SHA = 1, GNUTLS_SIGN_DSA_SHA,
+ GNUTLS_SIGN_RSA_SHA1 = 1, GNUTLS_SIGN_DSA_SHA1,
GNUTLS_SIGN_RSA_MD5, GNUTLS_SIGN_RSA_MD2, GNUTLS_SIGN_RSA_RMD160
} gnutls_sign_algorithm_t;
};
static const int comp_priority[] = { GNUTLS_COMP_NULL, 0 };
static const int mac_priority[] =
- { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, GNUTLS_MAC_RMD160, 0 };
+ { GNUTLS_MAC_SHA1, GNUTLS_MAC_MD5, GNUTLS_MAC_RMD160, 0 };
gnutls_cipher_set_priority(session, cipher_priority);
gnutls_compression_set_priority(session, comp_priority);
};
static const int comp_priority[] = { GNUTLS_COMP_NULL, 0 };
static const int mac_priority[] =
- { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, GNUTLS_MAC_RMD160, 0 };
+ { GNUTLS_MAC_SHA1, GNUTLS_MAC_MD5, GNUTLS_MAC_RMD160, 0 };
gnutls_cipher_set_priority(session, cipher_priority);
gnutls_compression_set_priority(session, comp_priority);
opaque concat[36];
- td_sha = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ td_sha = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (td_sha == NULL) {
gnutls_assert();
return GNUTLS_E_HASH_FAILED;
return GNUTLS_E_HASH_FAILED;
}
- td_sha = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ td_sha = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (td_sha == NULL) {
gnutls_assert();
_gnutls_hash_deinit(td_md5, NULL);
_gnutls_mpi_print(&holder[n_size - a_size], &a_size, A);
_gnutls_mpi_print(&holder[n_size + n_size - b_size], &b_size, B);
- td = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ td = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (td == NULL) {
gnutls_free(holder);
gnutls_assert();
*size = 20;
- td = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ td = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (td == NULL) {
return GNUTLS_E_MEMORY_ERROR;
}
_gnutls_hash_deinit(td, res);
- td = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ td = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (td == NULL) {
return GNUTLS_E_MEMORY_ERROR;
}
}
result =
- _gnutls_P_hash(GNUTLS_MAC_SHA, s2, l_s, s_seed, s_seed_size,
+ _gnutls_P_hash(GNUTLS_MAC_SHA1, s2, l_s, s_seed, s_seed_size,
total_bytes, o2);
if (result < 0) {
gnutls_assert();
* @crl: should contain a gnutls_x509_crl_t structure
* @issuer: is the certificate of the certificate issuer
* @issuer_key: holds the issuer's private key
- * @dig: The message digest to use. GNUTLS_DIG_SHA is the safe choice unless you know what you're doing.
+ * @dig: The message digest to use. GNUTLS_DIG_SHA1 is the safe choice unless you know what you're doing.
* @flags: must be 0
*
* This function will sign the CRL with the issuer's private key, and
int gnutls_x509_crl_sign(gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer,
gnutls_x509_privkey_t issuer_key)
{
- return gnutls_x509_crl_sign2( crl, issuer, issuer_key, GNUTLS_MAC_SHA, 0);
+ return gnutls_x509_crl_sign2( crl, issuer, issuer_key, GNUTLS_MAC_SHA1, 0);
}
/**
* gnutls_x509_crq_sign2 - This function will sign a Certificate request with a key
* @crq: should contain a gnutls_x509_crq_t structure
* @key: holds a private key
- * @dig: The message digest to use. GNUTLS_DIG_SHA is the safe choice unless you know what you're doing.
+ * @dig: The message digest to use. GNUTLS_DIG_SHA1 is the safe choice unless you know what you're doing.
* @flags: must be 0
*
* This function will sign the certificate request with a private key.
**/
int gnutls_x509_crq_sign(gnutls_x509_crq_t crq, gnutls_x509_privkey_t key)
{
- return gnutls_x509_crq_sign2(crq, key, GNUTLS_MAC_SHA, 0);
+ return gnutls_x509_crq_sign2(crq, key, GNUTLS_MAC_SHA1, 0);
}
/**
/* MAC the data
*/
- td1 = _gnutls_hmac_init(GNUTLS_MAC_SHA, key, sizeof(key));
+ td1 = _gnutls_hmac_init(GNUTLS_MAC_SHA1, key, sizeof(key));
if (td1 == GNUTLS_MAC_FAILED) {
gnutls_assert();
result = GNUTLS_E_INTERNAL_ERROR;
/* MAC the data
*/
- td1 = _gnutls_hmac_init(GNUTLS_MAC_SHA, key, sizeof(key));
+ td1 = _gnutls_hmac_init(GNUTLS_MAC_SHA1, key, sizeof(key));
if (td1 == GNUTLS_MAC_FAILED) {
gnutls_assert();
result = GNUTLS_E_INTERNAL_ERROR;
} else
return GNUTLS_E_INTERNAL_ERROR;
- hd = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ hd = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (hd == GNUTLS_HASH_FAILED) {
gnutls_assert();
result = GNUTLS_E_INTERNAL_ERROR;
* @flags: should be 0 for now
* @data: holds the data to be signed
* @signature: will contain the signature
- * @signature_size: holds the size of signature (and will be replaced by the new size)
+ * @signature_size: holds the size of signature (and will be replaced
+ * by the new size)
*
- * This function will sign the given data using a signature algorithm supported by
- * the private key. Signature algorithms are always used together with a hash functions.
- * Different hash functions may be used for the RSA algorithm, but only
- * SHA-1 for the DSA keys.
+ * This function will sign the given data using a signature algorithm
+ * supported by the private key. Signature algorithms are always used
+ * together with a hash functions. Different hash functions may be
+ * used for the RSA algorithm, but only SHA-1 for the DSA keys.
*
* If the buffer provided is not long enough to hold the output, then
- * &signature_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be returned.
+ * *signature_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
+ * be returned.
*
* In case of failure a negative value will be returned, and
* 0 on success.
GNUTLS_HASH_HANDLE hd;
gnutls_datum_t digest;
- hd = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ hd = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (hd == NULL) {
gnutls_assert();
return GNUTLS_E_HASH_FAILED;
gnutls_datum_t digest;
GNUTLS_HASH_HANDLE hd;
- hd = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ hd = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (hd == NULL) {
gnutls_assert();
return GNUTLS_E_HASH_FAILED;
* @buf: a pointer to a structure to hold the name (may be null)
* @sizeof_buf: initially holds the size of @buf
*
- * This function will copy the name of the Certificate issuer in the provided buffer. The name
- * will be in the form "C=xxxx,O=yyyy,CN=zzzz" as described in RFC2253. The output
- * string will be ASCII or UTF-8 encoded, depending on the certificate data.
+ * This function will copy the name of the Certificate issuer in the
+ * provided buffer. The name will be in the form
+ * "C=xxxx,O=yyyy,CN=zzzz" as described in RFC2253. The output string
+ * will be ASCII or UTF-8 encoded, depending on the certificate data.
*
* If @buf is null then only the size will be filled.
*
- * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and
- * in that case the &sizeof_buf will be updated with the required size.
- * On success 0 is returned.
+ * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
+ * long enough, and in that case the *sizeof_buf will be updated with
+ * the required size. On success 0 is returned.
*
**/
int gnutls_x509_crt_get_issuer_dn(gnutls_x509_crt_t cert, char *buf,
* @buf: a pointer to a structure to hold the name (may be null)
* @sizeof_buf: initially holds the size of @buf
*
- * This function will extract the part of the name of the Certificate issuer specified
- * by the given OID. The output will be encoded as described in RFC2253. The output
- * string will be ASCII or UTF-8 encoded, depending on the certificate data.
+ * This function will extract the part of the name of the Certificate
+ * issuer specified by the given OID. The output will be encoded as
+ * described in RFC2253. The output string will be ASCII or UTF-8
+ * encoded, depending on the certificate data.
*
* Some helper macros with popular OIDs can be found in gnutls/x509.h
- * If raw flag is zero, this function will only return known OIDs as text. Other OIDs
- * will be DER encoded, as described in RFC2253 -- in hex format with a '\#' prefix.
- * You can check about known OIDs using gnutls_x509_dn_oid_known().
+ * If raw flag is zero, this function will only return known OIDs as
+ * text. Other OIDs will be DER encoded, as described in RFC2253 --
+ * in hex format with a '\#' prefix. You can check about known OIDs
+ * using gnutls_x509_dn_oid_known().
*
* If @buf is null then only the size will be filled.
*
- * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and
- * in that case the &sizeof_buf will be updated with the required size.
- * On success 0 is returned.
+ * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
+ * long enough, and in that case the *sizeof_buf will be updated with
+ * the required size. On success 0 is returned.
*
**/
int gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt_t cert,
* @oid: a pointer to a buffer to hold the OID (may be null)
* @sizeof_oid: initially holds the size of @oid
*
- * This function will extract the OIDs of the name of the Certificate issuer specified
- * by the given index.
+ * This function will extract the OIDs of the name of the Certificate
+ * issuer specified by the given index.
*
* If @oid is null then only the size will be filled.
*
- * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and
- * in that case the &sizeof_oid will be updated with the required size.
- * On success 0 is returned.
+ * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
+ * long enough, and in that case the *sizeof_oid will be updated with
+ * the required size. On success 0 is returned.
*
**/
int gnutls_x509_crt_get_issuer_dn_oid(gnutls_x509_crt_t cert,
* @buf: a pointer to a structure to hold the name (may be null)
* @sizeof_buf: initially holds the size of @buf
*
- * This function will copy the name of the Certificate in the provided buffer. The name
- * will be in the form "C=xxxx,O=yyyy,CN=zzzz" as described in RFC2253. The output
- * string will be ASCII or UTF-8 encoded, depending on the certificate data.
+ * This function will copy the name of the Certificate in the
+ * provided buffer. The name will be in the form
+ * "C=xxxx,O=yyyy,CN=zzzz" as described in RFC2253. The output string
+ * will be ASCII or UTF-8 encoded, depending on the certificate data.
*
* If @buf is null then only the size will be filled.
*
- * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and
- * in that case the &sizeof_buf will be updated with the required size.
- * On success 0 is returned.
+ * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
+ * long enough, and in that case the *sizeof_buf will be updated with
+ * the required size. On success 0 is returned.
*
**/
int gnutls_x509_crt_get_dn(gnutls_x509_crt_t cert, char *buf,
* @buf: a pointer to a structure to hold the name (may be null)
* @sizeof_buf: initially holds the size of @buf
*
- * This function will extract the part of the name of the Certificate subject, specified
- * by the given OID. The output
- * string will be ASCII or UTF-8 encoded, depending on the certificate data.
+ * This function will extract the part of the name of the Certificate
+ * subject, specified by the given OID. The output string will be
+ * ASCII or UTF-8 encoded, depending on the certificate data.
*
* Some helper macros with popular OIDs can be found in gnutls/x509.h
- * If raw flag is zero, this function will only return known OIDs as text. Other OIDs
- * will be DER encoded, as described in RFC2253 -- in hex format with a '\#' prefix.
- * You can check about known OIDs using gnutls_x509_dn_oid_known().
+ * If raw flag is zero, this function will only return known OIDs as
+ * text. Other OIDs will be DER encoded, as described in RFC2253 --
+ * in hex format with a '\#' prefix. You can check about known OIDs
+ * using gnutls_x509_dn_oid_known().
*
* If @buf is null then only the size will be filled.
*
- * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and
- * in that case the &sizeof_buf will be updated with the required size.
- * On success 0 is returned.
+ * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
+ * long enough, and in that case the *sizeof_buf will be updated with
+ * the required size. On success 0 is returned.
*
**/
int gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert, const char *oid,
* @oid: a pointer to a buffer to hold the OID (may be null)
* @sizeof_oid: initially holds the size of @oid
*
- * This function will extract the OIDs of the name of the Certificate subject specified
- * by the given index.
+ * This function will extract the OIDs of the name of the Certificate
+ * subject specified by the given index.
*
* If oid is null then only the size will be filled.
*
- * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and
- * in that case the &sizeof_oid will be updated with the required size.
- * On success 0 is returned.
+ * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
+ * long enough, and in that case the *sizeof_oid will be updated with
+ * the required size. On success 0 is returned.
*
**/
int gnutls_x509_crt_get_dn_oid(gnutls_x509_crt_t cert,
*
* If the buffer is null then only the size will be filled.
*
- * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and
- * in that case the &sizeof_buf will be updated with the required size.
- * On success 0 is returned.
+ * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
+ * long enough, and in that case the *sizeof_buf will be updated with
+ * the required size. On success 0 is returned.
*
**/
int gnutls_x509_crt_get_fingerprint(gnutls_x509_crt_t cert,
} else
return GNUTLS_E_INTERNAL_ERROR;
- hd = _gnutls_hash_init(GNUTLS_MAC_SHA);
+ hd = _gnutls_hash_init(GNUTLS_MAC_SHA1);
if (hd == GNUTLS_HASH_FAILED) {
gnutls_assert();
result = GNUTLS_E_INTERNAL_ERROR;
* @oid: a pointer to a buffer to hold the OID (may be null)
* @sizeof_oid: initially holds the size of @oid
*
- * This function will extract the key purpose OIDs of the Certificate specified
- * by the given index. These are stored in the Extended Key Usage extension (2.5.29.37)
- * See the GNUTLS_KP_* definitions for human readable names.
+ * This function will extract the key purpose OIDs of the Certificate
+ * specified by the given index. These are stored in the Extended Key
+ * Usage extension (2.5.29.37) See the GNUTLS_KP_* definitions for
+ * human readable names.
*
* If @oid is null then only the size will be filled.
*
- * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and
- * in that case the &sizeof_oid will be updated with the required size.
- * On success 0 is returned.
+ * Returns GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
+ * long enough, and in that case the *sizeof_oid will be updated with
+ * the required size. On success 0 is returned.
*
**/
int gnutls_x509_crt_get_key_purpose_oid(gnutls_x509_crt_t cert,
* @crt: should contain a gnutls_x509_crt_t structure
* @issuer: is the certificate of the certificate issuer
* @issuer_key: holds the issuer's private key
- * @dig: The message digest to use. GNUTLS_DIG_SHA is the safe choice unless you know what you're doing.
+ * @dig: The message digest to use. GNUTLS_DIG_SHA1 is the safe choice unless you know what you're doing.
* @flags: must be 0
*
* This function will sign the certificate with the issuer's private key, and
int gnutls_x509_crt_sign(gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer,
gnutls_x509_privkey_t issuer_key)
{
- return gnutls_x509_crt_sign2( crt, issuer, issuer_key, GNUTLS_MAC_SHA, 0);
+ return gnutls_x509_crt_sign2( crt, issuer, issuer_key, GNUTLS_MAC_SHA1, 0);
}
/**
m->kx_priority[2] = GNUTLS_KX_DHE_DSS;
m->kx_priority[3] = 0;
- m->mac_priority[0] = GNUTLS_MAC_SHA;
+ m->mac_priority[0] = GNUTLS_MAC_SHA1;
m->mac_priority[1] = GNUTLS_MAC_MD5;
m->mac_priority[2] = 0;
m->kx_priority[2] = GNUTLS_KX_DHE_DSS;
m->kx_priority[3] = 0;
- m->mac_priority[0] = GNUTLS_MAC_SHA;
+ m->mac_priority[0] = GNUTLS_MAC_SHA1;
m->mac_priority[1] = GNUTLS_MAC_MD5;
m->mac_priority[2] = 0;
m->kx_priority[2] = GNUTLS_KX_DHE_DSS;
m->kx_priority[3] = 0;
- m->mac_priority[0] = GNUTLS_MAC_SHA;
+ m->mac_priority[0] = GNUTLS_MAC_SHA1;
m->mac_priority[1] = GNUTLS_MAC_MD5;
m->mac_priority[2] = 0;
m->kx_priority[2] = GNUTLS_KX_DHE_DSS;
m->kx_priority[3] = 0;
- m->mac_priority[0] = GNUTLS_MAC_SHA;
+ m->mac_priority[0] = GNUTLS_MAC_SHA1;
m->mac_priority[1] = GNUTLS_MAC_MD5;
m->mac_priority[2] = 0;
m->kx_priority[2] = GNUTLS_KX_DHE_DSS;
m->kx_priority[3] = 0;
- m->mac_priority[0] = GNUTLS_MAC_SHA;
+ m->mac_priority[0] = GNUTLS_MAC_SHA1;
m->mac_priority[1] = GNUTLS_MAC_MD5;
m->mac_priority[2] = 0;
m->kx_priority[2] = GNUTLS_KX_DHE_DSS;
m->kx_priority[3] = 0;
- m->mac_priority[0] = GNUTLS_MAC_SHA;
+ m->mac_priority[0] = GNUTLS_MAC_SHA1;
m->mac_priority[1] = GNUTLS_MAC_MD5;
m->mac_priority[2] = 0;
FILE *infile;
static int in_cert_format;
static int out_cert_format;
-gnutls_digest_algorithm_t dig = GNUTLS_DIG_SHA;
+gnutls_digest_algorithm_t dig = GNUTLS_DIG_SHA1;
#define UNKNOWN "Unknown"
fprintf(stderr, "Warning: MD5 is broken, and should not be used any more for digital signatures.\n");
dig = GNUTLS_DIG_MD5;
} else if (strcasecmp(info.hash, "sha1")==0)
- dig = GNUTLS_DIG_SHA;
+ dig = GNUTLS_DIG_SHA1;
else if (strcasecmp(info.hash, "rmd160")==0)
dig = GNUTLS_DIG_RMD160;
else fprintf(stderr, "Unsupported hash algorithm '%s'. Using the default.\n", info.hash);
if (all) {
size = sizeof(buffer);
if ((ret =
- gnutls_x509_crt_get_fingerprint(crt, GNUTLS_DIG_SHA, buffer,
+ gnutls_x509_crt_get_fingerprint(crt, GNUTLS_DIG_MD5, buffer,
&size)) < 0) {
fprintf(out, "Error in fingerprint calculation: %s\n",
gnutls_strerror(ret));
sprintf(print, "%.2x ", (unsigned char) buffer[i]);
print += 3;
}
- fprintf(out, "\tFingerprint: %s\n", printable);
+ fprintf(out, "\tMD5 Fingerprint: %s\n", printable);
}
+
+ if ((ret =
+ gnutls_x509_crt_get_fingerprint(crt, GNUTLS_DIG_SHA1, buffer,
+ &size)) < 0) {
+ fprintf(out, "Error in fingerprint calculation: %s\n",
+ gnutls_strerror(ret));
+ } else {
+ print = printable;
+ for (i = 0; i < size; i++) {
+ sprintf(print, "%.2x ", (unsigned char) buffer[i]);
+ print += 3;
+ }
+ fprintf(out, "\tSHA1 Fingerprint: %s\n", printable);
+ }
+
}
size = sizeof(buffer);
};
int comp_priority[PRI_MAX] = { GNUTLS_COMP_ZLIB, GNUTLS_COMP_NULL, 0 };
int mac_priority[PRI_MAX] =
- { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, GNUTLS_MAC_RMD160, 0 };
+ { GNUTLS_MAC_SHA1, GNUTLS_MAC_MD5, GNUTLS_MAC_RMD160, 0 };
int cert_type_priority[PRI_MAX] =
{ GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 };
else if (strncasecmp(macs[i], "RMD", 3) == 0)
mac_priority[j++] = GNUTLS_MAC_RMD160;
else if (strncasecmp(macs[i], "SHA", 3) == 0)
- mac_priority[j++] = GNUTLS_MAC_SHA;
+ mac_priority[j++] = GNUTLS_MAC_SHA1;
else
fprintf(stderr, "Unknown MAC: '%s'\n", macs[i]);
}
int comp_priority[PRI_MAX] =
{ GNUTLS_COMP_ZLIB, GNUTLS_COMP_LZO, GNUTLS_COMP_NULL, 0 };
int mac_priority[PRI_MAX] =
- { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, GNUTLS_MAC_RMD160, 0 };
+ { GNUTLS_MAC_SHA1, GNUTLS_MAC_MD5, GNUTLS_MAC_RMD160, 0 };
int cert_type_priority[PRI_MAX] =
{ GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 };
GNUTLS_CIPHER_ARCFOUR_40, 0
};
static const int comp_priority[16] = { GNUTLS_COMP_NULL, 0 };
-static const int mac_priority[16] = { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 };
+static const int mac_priority[16] = { GNUTLS_MAC_SHA1, GNUTLS_MAC_MD5, 0 };
static const int cert_type_priority[16] = { GNUTLS_CRT_X509, 0 };
#define ADD_ALL_CIPHERS(session) gnutls_cipher_set_priority(session, cipher_priority)
ADD_ALL_COMP(session);
ADD_ALL_CERTTYPES(session);
ADD_ALL_PROTOCOLS(session);
- ADD_MAC(session, GNUTLS_MAC_SHA);
+ ADD_MAC(session, GNUTLS_MAC_SHA1);
ADD_ALL_KX(session);
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);