Index: /branches/rel_avx_2_7_3/src/backend/ntp.c
===================================================================
--- /branches/rel_avx_2_7_3/src/backend/ntp.c	(revision 8974)
+++ /branches/rel_avx_2_7_3/src/backend/ntp.c	(working copy)
@@ -464,6 +464,34 @@
 	int cases = sizeof(support_options) / sizeof(support_options[0]);
 	int i, unsupport = 1;
 
+	if (key_id) {
+		FILE *fp = NULL;
+		char linebuf[1024];
+
+		fp = fopen(AVX_NTP_KEYS_FILE, "r");
+		int find = 0;
+		while (fgets(linebuf, sizeof(linebuf), fp)) {
+			// Skip empty lines or comment lines
+			if (*linebuf == '\0' || *linebuf == '#') {
+				continue;
+			}
+
+			// Extract the first number
+			int key;
+			if (sscanf(linebuf, "%d", &key) == 1 && key_id == key) {
+				find = 1;
+				break;
+			}
+		}
+
+		fclose(fp);
+		fp = NULL;
+		if (find == 0) {
+			printf("Unknown Authentication Key ID: %d.", key_id);
+			return 1;
+		}
+	}
+
 	// empty option case
 	if (!option || option[0] == '\0') {
 		snprintf(cmd, sizeof(cmd), "python /ca/bin/chrony_setup.py -a 'server %s", ip);
