Commit d178c283179aedc9c3b019af1fecfcb181d9077b

Authored by panlinlin
1 parent ae32f978

修复空指针

src/main/java/com/genersoft/iot/vmp/gb28181/auth/DigestServerAuthenticationHelper.java
... ... @@ -105,11 +105,11 @@ public class DigestServerAuthenticationHelper {
105 105 proxyAuthenticate.setParameter("realm", realm);
106 106 proxyAuthenticate.setParameter("nonce", generateNonce());
107 107  
108   -// proxyAuthenticate.setParameter("opaque", "");
109   -// proxyAuthenticate.setParameter("stale", "FALSE");
110   -// proxyAuthenticate.setParameter("algorithm", DEFAULT_ALGORITHM);
  108 + proxyAuthenticate.setParameter("opaque", "");
  109 + proxyAuthenticate.setParameter("stale", "FALSE");
  110 + proxyAuthenticate.setParameter("algorithm", DEFAULT_ALGORITHM);
111 111  
112   - proxyAuthenticate.setParameter("qop", "auth");
  112 +// proxyAuthenticate.setParameter("qop", "auth");
113 113 response.setHeader(proxyAuthenticate);
114 114 } catch (Exception ex) {
115 115 InternalErrorHandler.handleException(ex);
... ... @@ -187,11 +187,11 @@ public class DigestServerAuthenticationHelper {
187 187 return false;
188 188 }
189 189 // qop 保护质量 包含auth(默认的)和auth-int(增加了报文完整性检测)两种策略
190   - String qop = authHeader.getQop().trim();
  190 + String qop = authHeader.getQop();
191 191  
192 192 // 客户端随机数,这是一个不透明的字符串值,由客户端提供,并且客户端和服务器都会使用,以避免用明文文本。
193 193 // 这使得双方都可以查验对方的身份,并对消息的完整性提供一些保护
194   - String cNonce = authHeader.getCNonce().trim();
  194 + String cNonce = authHeader.getCNonce();
195 195  
196 196 // nonce计数器,是一个16进制的数值,表示同一nonce下客户端发送出请求的数量
197 197 int nc = authHeader.getNonceCount();
... ...