mirror of https://github.com/grpc/grpc-node.git
				
				
				
			Fix handling of subject alternative names with colons
This commit is contained in:
		
							parent
							
								
									65f4d76f15
								
							
						
					
					
						commit
						7d99c4a7aa
					
				|  | @ -84,11 +84,13 @@ class DnsExactValueMatcher implements ValueMatcher { | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   apply(entry: string): boolean { |   apply(entry: string): boolean { | ||||||
|     let [type, value] = entry.split(':'); |     const colonIndex = entry.indexOf(':'); | ||||||
|     if (!isSupportedSanType(type)) { |     if (colonIndex < 0) { | ||||||
|       return false; |       return false; | ||||||
|     } |     } | ||||||
|     if (!value) { |     const type = entry.substring(0, colonIndex); | ||||||
|  |     let value = entry.substring(colonIndex + 1); | ||||||
|  |     if (!isSupportedSanType(type)) { | ||||||
|       return false; |       return false; | ||||||
|     } |     } | ||||||
|     if (this.ignoreCase) { |     if (this.ignoreCase) { | ||||||
|  | @ -137,14 +139,16 @@ class SanEntryMatcher implements ValueMatcher { | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   apply(entry: string): boolean { |   apply(entry: string): boolean { | ||||||
|     let [type, value] = entry.split(':'); |     const colonIndex = entry.indexOf(':'); | ||||||
|  |     if (colonIndex < 0) { | ||||||
|  |       return false; | ||||||
|  |     } | ||||||
|  |     const type = entry.substring(0, colonIndex); | ||||||
|  |     let value = entry.substring(colonIndex + 1); | ||||||
|     if (!isSupportedSanType(type)) { |     if (!isSupportedSanType(type)) { | ||||||
|       return false; |       return false; | ||||||
|     } |     } | ||||||
|     value = canonicalizeSanEntryValue(type, value); |     value = canonicalizeSanEntryValue(type, value); | ||||||
|     if (!entry) { |  | ||||||
|       return false; |  | ||||||
|     } |  | ||||||
|     return this.childMatcher.apply(value); |     return this.childMatcher.apply(value); | ||||||
|   } |   } | ||||||
|   toString(): string { |   toString(): string { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue