if (len != 20) {
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_OPENPGP_FINGERPRINT_UNSUPPORTED;
}
DECR_LEN(dsize, 20);
} else {
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE;
}
/* ok we now have the peer's key in tmp datum
break;
default:
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_INTERNAL_ERROR;
}
}
}
ERROR_ENTRY("The SRP username supplied by the peer is illegal.", GNUTLS_E_ILLEGAL_SRP_USERNAME, 1),
ERROR_ENTRY("The peer advertized SRP but did not supply any SRP username.", GNUTLS_E_EMPTY_SRP_USERNAME, 1),
+
+ ERROR_ENTRY("The OpenPGP fingerprint is not supported.", GNUTLS_E_OPENPGP_FINGERPRINT_UNSUPPORTED, 1),
+ ERROR_ENTRY("The certificate has unsupported attributes.", GNUTLS_E_X509_UNSUPPORTED_ATTRIBUTE, 1),
+ ERROR_ENTRY("The hash algorithm is unknown.", GNUTLS_E_UNKNOWN_HASH_ALGORITHM, 1),
{0, 0, 0, 0}
};
#define GNUTLS_E_GOT_APPLICATION_DATA -38
#define GNUTLS_E_RECORD_LIMIT_REACHED -39
#define GNUTLS_E_ENCRYPTION_FAILED -40
-#define GNUTLS_E_CERTIFICATE_ERROR -43
-#define GNUTLS_E_X509_CERTIFICATE_ERROR GNUTLS_E_CERTIFICATE_ERROR
#define GNUTLS_E_PK_ENCRYPTION_FAILED -44
#define GNUTLS_E_PK_DECRYPTION_FAILED -45
#define GNUTLS_E_PKCS1_WRONG_PAD -57
#define GNUTLS_E_RECEIVED_ILLEGAL_EXTENSION -58
#define GNUTLS_E_INTERNAL_ERROR -59
-#define GNUTLS_E_CERTIFICATE_KEY_MISMATCH -60
-#define GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE -61 /* GNUTLS_A_UNSUPPORTED_CERTIFICATE */
-#define GNUTLS_E_X509_UNKNOWN_SAN -62
#define GNUTLS_E_DH_PRIME_UNACCEPTABLE -63
#define GNUTLS_E_FILE_ERROR -64
-#define GNUTLS_E_ASN1_ELEMENT_NOT_FOUND -67
-#define GNUTLS_E_ASN1_IDENTIFIER_NOT_FOUND -68
-#define GNUTLS_E_ASN1_DER_ERROR -69
-#define GNUTLS_E_ASN1_VALUE_NOT_FOUND -70
-#define GNUTLS_E_ASN1_GENERIC_ERROR -71
-#define GNUTLS_E_ASN1_VALUE_NOT_VALID -72
-#define GNUTLS_E_ASN1_TAG_ERROR -73
-#define GNUTLS_E_ASN1_TAG_IMPLICIT -74
-#define GNUTLS_E_ASN1_TYPE_ANY_ERROR -75
-#define GNUTLS_E_ASN1_SYNTAX_ERROR -76
-#define GNUTLS_E_ASN1_DER_OVERFLOW -77
#define GNUTLS_E_TOO_MANY_EMPTY_PACKETS -78
-#define GNUTLS_E_OPENPGP_UID_REVOKED -79
#define GNUTLS_E_UNKNOWN_PK_ALGORITHM -80
-#define GNUTLS_E_OPENPGP_TRUSTDB_VERSION_UNSUPPORTED -81
+
/* returned if libextra functionality was requested but
* gnutls_global_init_extra() was not called.
#define GNUTLS_E_EMPTY_SRP_USERNAME -92
#define GNUTLS_E_NO_TEMPORARY_DH_PARAMS -93
+/* For certificate and key stuff
+ */
+#define GNUTLS_E_ASN1_ELEMENT_NOT_FOUND -67
+#define GNUTLS_E_ASN1_IDENTIFIER_NOT_FOUND -68
+#define GNUTLS_E_ASN1_DER_ERROR -69
+#define GNUTLS_E_ASN1_VALUE_NOT_FOUND -70
+#define GNUTLS_E_ASN1_GENERIC_ERROR -71
+#define GNUTLS_E_ASN1_VALUE_NOT_VALID -72
+#define GNUTLS_E_ASN1_TAG_ERROR -73
+#define GNUTLS_E_ASN1_TAG_IMPLICIT -74
+#define GNUTLS_E_ASN1_TYPE_ANY_ERROR -75
+#define GNUTLS_E_ASN1_SYNTAX_ERROR -76
+#define GNUTLS_E_ASN1_DER_OVERFLOW -77
+#define GNUTLS_E_OPENPGP_TRUSTDB_VERSION_UNSUPPORTED -81
+#define GNUTLS_E_OPENPGP_UID_REVOKED -79
+#define GNUTLS_E_CERTIFICATE_ERROR -43
+#define GNUTLS_E_X509_CERTIFICATE_ERROR GNUTLS_E_CERTIFICATE_ERROR
+#define GNUTLS_E_CERTIFICATE_KEY_MISMATCH -60
+#define GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE -61 /* GNUTLS_A_UNSUPPORTED_CERTIFICATE */
+#define GNUTLS_E_X509_UNKNOWN_SAN -62
+#define GNUTLS_E_OPENPGP_FINGERPRINT_UNSUPPORTED -94
+#define GNUTLS_E_X509_UNSUPPORTED_ATTRIBUTE -95
+#define GNUTLS_E_UNKNOWN_HASH_ALGORITHM -96
+
#define GNUTLS_E_UNIMPLEMENTED_FEATURE -250
/* _INT_ internal errors. Not exported */
if (packed_session==NULL) {
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_INTERNAL_ERROR;
}
}
break;
default:
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_INTERNAL_ERROR;
}
if (packed_session==NULL || packed_session->size == 0) {
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_INTERNAL_ERROR;
}
if (session->key->auth_info != NULL) {
break;
default:
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_INTERNAL_ERROR;
}
break;
default:
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_INTERNAL_ERROR;
break;
}
default:
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_INTERNAL_ERROR;
}
if (len % 8 != 0) {
gnutls_assert();
- result = GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ result = GNUTLS_E_CERTIFICATE_ERROR;
goto cleanup;
}
/* Parses an Attribute list in the asn1_struct, and searches for the
* given OID. The index indicates the attribute value to be returned.
*
- * Only printable data are returned, or GNUTLS_E_UNIMPLEMENTED_FEATURE.
+ * Only printable data are returned, or GNUTLS_E_X509_UNSUPPORTED_ATTRIBUTE.
*
* asn1_attr_name must be a string in the form "certificationRequestInfo.attributes"
*
return 0;
} else {
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_X509_UNSUPPORTED_ATTRIBUTE;
}
}
* @key: holds a private key
*
* This function will set the public parameters from the given private key to the
- * request.
+ * request. Only RSA keys are currently supported.
*
* On success zero is returned.
*
pk = _gnutls_x509_pk2oid( key->pk_algorithm);
if (pk == NULL) {
gnutls_assert();
- return GNUTLS_E_INVALID_REQUEST;
+ return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
}
/* write the RSA OID
*ret = _gnutls_read_uint32(tmpstr);
else {
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_INTERNAL_ERROR;
}
return 0;
* @flags: unused for now. Must be 0.
*
* This function will generate a random private key. Note that
- * this function must be called on an empty private key.
+ * this function must be called on an empty private key. Currently only RSA
+ * keys can be generated.
*
* Returns 0 on success or a negative value on error.
*
* @output_data_size: holds the size of output_data (and will be replaced by the actual size of parameters)
*
* This function will export the private key to a PKCS8 structure.
+ * Currently only RSA keys can be exported.
*
* If the buffer provided is not long enough to hold the output, then
* GNUTLS_E_SHORT_MEMORY_BUFFER will be returned.
*
* This function will convert the given DER or PEM encoded PKCS8 2.0 encrypted key
* to the native gnutls_x509_privkey format. The output will be stored in 'key'.
+ * Currently only RSA keys can be imported.
*
* If the Certificate is PEM encoded it should have a header of "ENCRYPTED PRIVATE KEY",
* or "PRIVATE KEY". You only need to specify the flags if the key is DER encoded.
algo = _gnutls_x509_mac2oid( hash);
if (algo == NULL) {
gnutls_assert();
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
}
if ((result=asn1_create_element( _gnutls_get_gnutls_asn(),
gnutls_assert();
asn1_delete_structure(&dinfo);
- return GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ return GNUTLS_E_UNKNOWN_HASH_ALGORITHM;
}
result =
if (len % 8 != 0) {
gnutls_assert();
- result = GNUTLS_E_UNIMPLEMENTED_FEATURE;
+ result = GNUTLS_E_CERTIFICATE_ERROR;
goto cleanup;
}