make sure minor_status is always set, pointed out by Luke Howard <lukeh@PADL.COM>
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12343 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		@@ -59,10 +59,8 @@ verify_mic_des
 | 
				
			|||||||
  ret = gssapi_krb5_verify_header (&p,
 | 
					  ret = gssapi_krb5_verify_header (&p,
 | 
				
			||||||
				   token_buffer->length,
 | 
									   token_buffer->length,
 | 
				
			||||||
				   type);
 | 
									   type);
 | 
				
			||||||
  if (ret) {
 | 
					  if (ret)
 | 
				
			||||||
      *minor_status = 0;
 | 
					 | 
				
			||||||
      return ret;
 | 
					      return ret;
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (memcmp(p, "\x00\x00", 2) != 0)
 | 
					  if (memcmp(p, "\x00\x00", 2) != 0)
 | 
				
			||||||
      return GSS_S_BAD_SIG;
 | 
					      return GSS_S_BAD_SIG;
 | 
				
			||||||
@@ -88,7 +86,6 @@ verify_mic_des
 | 
				
			|||||||
  if (memcmp (p - 8, hash, 8) != 0) {
 | 
					  if (memcmp (p - 8, hash, 8) != 0) {
 | 
				
			||||||
    memset (deskey, 0, sizeof(deskey));
 | 
					    memset (deskey, 0, sizeof(deskey));
 | 
				
			||||||
    memset (schedule, 0, sizeof(schedule));
 | 
					    memset (schedule, 0, sizeof(schedule));
 | 
				
			||||||
    *minor_status = 0;
 | 
					 | 
				
			||||||
    return GSS_S_BAD_MIC;
 | 
					    return GSS_S_BAD_MIC;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -115,7 +112,6 @@ verify_mic_des
 | 
				
			|||||||
  memset (schedule, 0, sizeof(schedule));
 | 
					  memset (schedule, 0, sizeof(schedule));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (memcmp (p, seq_data, 8) != 0) {
 | 
					  if (memcmp (p, seq_data, 8) != 0) {
 | 
				
			||||||
    *minor_status = 0;
 | 
					 | 
				
			||||||
    return GSS_S_BAD_MIC;
 | 
					    return GSS_S_BAD_MIC;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -124,7 +120,6 @@ verify_mic_des
 | 
				
			|||||||
				++seq_number);
 | 
									++seq_number);
 | 
				
			||||||
  HEIMDAL_MUTEX_unlock(&context_handle->ctx_id_mutex);
 | 
					  HEIMDAL_MUTEX_unlock(&context_handle->ctx_id_mutex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  *minor_status = 0;
 | 
					 | 
				
			||||||
  return GSS_S_COMPLETE;
 | 
					  return GSS_S_COMPLETE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -154,10 +149,8 @@ verify_mic_des3
 | 
				
			|||||||
  ret = gssapi_krb5_verify_header (&p,
 | 
					  ret = gssapi_krb5_verify_header (&p,
 | 
				
			||||||
				   token_buffer->length,
 | 
									   token_buffer->length,
 | 
				
			||||||
				   type);
 | 
									   type);
 | 
				
			||||||
  if (ret) {
 | 
					  if (ret)
 | 
				
			||||||
      *minor_status = 0;
 | 
					 | 
				
			||||||
      return ret;
 | 
					      return ret;
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (memcmp(p, "\x04\x00", 2) != 0) /* SGN_ALG = HMAC SHA1 DES3-KD */
 | 
					  if (memcmp(p, "\x04\x00", 2) != 0) /* SGN_ALG = HMAC SHA1 DES3-KD */
 | 
				
			||||||
      return GSS_S_BAD_SIG;
 | 
					      return GSS_S_BAD_SIG;
 | 
				
			||||||
@@ -260,7 +253,6 @@ retry:
 | 
				
			|||||||
  HEIMDAL_MUTEX_unlock(&context_handle->ctx_id_mutex);
 | 
					  HEIMDAL_MUTEX_unlock(&context_handle->ctx_id_mutex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  krb5_crypto_destroy (gssapi_krb5_context, crypto);
 | 
					  krb5_crypto_destroy (gssapi_krb5_context, crypto);
 | 
				
			||||||
  *minor_status = 0;
 | 
					 | 
				
			||||||
  return GSS_S_COMPLETE;
 | 
					  return GSS_S_COMPLETE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -284,6 +276,7 @@ gss_verify_mic_internal
 | 
				
			|||||||
	*minor_status = ret;
 | 
						*minor_status = ret;
 | 
				
			||||||
	return GSS_S_FAILURE;
 | 
						return GSS_S_FAILURE;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    *minor_status = 0;
 | 
				
			||||||
    krb5_enctype_to_keytype (gssapi_krb5_context, key->keytype, &keytype);
 | 
					    krb5_enctype_to_keytype (gssapi_krb5_context, key->keytype, &keytype);
 | 
				
			||||||
    switch (keytype) {
 | 
					    switch (keytype) {
 | 
				
			||||||
    case KEYTYPE_DES :
 | 
					    case KEYTYPE_DES :
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,10 +59,8 @@ verify_mic_des
 | 
				
			|||||||
  ret = gssapi_krb5_verify_header (&p,
 | 
					  ret = gssapi_krb5_verify_header (&p,
 | 
				
			||||||
				   token_buffer->length,
 | 
									   token_buffer->length,
 | 
				
			||||||
				   type);
 | 
									   type);
 | 
				
			||||||
  if (ret) {
 | 
					  if (ret)
 | 
				
			||||||
      *minor_status = 0;
 | 
					 | 
				
			||||||
      return ret;
 | 
					      return ret;
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (memcmp(p, "\x00\x00", 2) != 0)
 | 
					  if (memcmp(p, "\x00\x00", 2) != 0)
 | 
				
			||||||
      return GSS_S_BAD_SIG;
 | 
					      return GSS_S_BAD_SIG;
 | 
				
			||||||
@@ -88,7 +86,6 @@ verify_mic_des
 | 
				
			|||||||
  if (memcmp (p - 8, hash, 8) != 0) {
 | 
					  if (memcmp (p - 8, hash, 8) != 0) {
 | 
				
			||||||
    memset (deskey, 0, sizeof(deskey));
 | 
					    memset (deskey, 0, sizeof(deskey));
 | 
				
			||||||
    memset (schedule, 0, sizeof(schedule));
 | 
					    memset (schedule, 0, sizeof(schedule));
 | 
				
			||||||
    *minor_status = 0;
 | 
					 | 
				
			||||||
    return GSS_S_BAD_MIC;
 | 
					    return GSS_S_BAD_MIC;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -115,7 +112,6 @@ verify_mic_des
 | 
				
			|||||||
  memset (schedule, 0, sizeof(schedule));
 | 
					  memset (schedule, 0, sizeof(schedule));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (memcmp (p, seq_data, 8) != 0) {
 | 
					  if (memcmp (p, seq_data, 8) != 0) {
 | 
				
			||||||
    *minor_status = 0;
 | 
					 | 
				
			||||||
    return GSS_S_BAD_MIC;
 | 
					    return GSS_S_BAD_MIC;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -124,7 +120,6 @@ verify_mic_des
 | 
				
			|||||||
				++seq_number);
 | 
									++seq_number);
 | 
				
			||||||
  HEIMDAL_MUTEX_unlock(&context_handle->ctx_id_mutex);
 | 
					  HEIMDAL_MUTEX_unlock(&context_handle->ctx_id_mutex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  *minor_status = 0;
 | 
					 | 
				
			||||||
  return GSS_S_COMPLETE;
 | 
					  return GSS_S_COMPLETE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -154,10 +149,8 @@ verify_mic_des3
 | 
				
			|||||||
  ret = gssapi_krb5_verify_header (&p,
 | 
					  ret = gssapi_krb5_verify_header (&p,
 | 
				
			||||||
				   token_buffer->length,
 | 
									   token_buffer->length,
 | 
				
			||||||
				   type);
 | 
									   type);
 | 
				
			||||||
  if (ret) {
 | 
					  if (ret)
 | 
				
			||||||
      *minor_status = 0;
 | 
					 | 
				
			||||||
      return ret;
 | 
					      return ret;
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (memcmp(p, "\x04\x00", 2) != 0) /* SGN_ALG = HMAC SHA1 DES3-KD */
 | 
					  if (memcmp(p, "\x04\x00", 2) != 0) /* SGN_ALG = HMAC SHA1 DES3-KD */
 | 
				
			||||||
      return GSS_S_BAD_SIG;
 | 
					      return GSS_S_BAD_SIG;
 | 
				
			||||||
@@ -260,7 +253,6 @@ retry:
 | 
				
			|||||||
  HEIMDAL_MUTEX_unlock(&context_handle->ctx_id_mutex);
 | 
					  HEIMDAL_MUTEX_unlock(&context_handle->ctx_id_mutex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  krb5_crypto_destroy (gssapi_krb5_context, crypto);
 | 
					  krb5_crypto_destroy (gssapi_krb5_context, crypto);
 | 
				
			||||||
  *minor_status = 0;
 | 
					 | 
				
			||||||
  return GSS_S_COMPLETE;
 | 
					  return GSS_S_COMPLETE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -284,6 +276,7 @@ gss_verify_mic_internal
 | 
				
			|||||||
	*minor_status = ret;
 | 
						*minor_status = ret;
 | 
				
			||||||
	return GSS_S_FAILURE;
 | 
						return GSS_S_FAILURE;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    *minor_status = 0;
 | 
				
			||||||
    krb5_enctype_to_keytype (gssapi_krb5_context, key->keytype, &keytype);
 | 
					    krb5_enctype_to_keytype (gssapi_krb5_context, key->keytype, &keytype);
 | 
				
			||||||
    switch (keytype) {
 | 
					    switch (keytype) {
 | 
				
			||||||
    case KEYTYPE_DES :
 | 
					    case KEYTYPE_DES :
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user